From gray at clhn.co  Fri Sep 13 19:52:37 2013
From: gray at clhn.co (Gray Calhoun)
Date: Fri, 13 Sep 2013 12:52:37 -0500
Subject: [Rd] declaring package dependencies
In-Reply-To: <004801ceb09c$72f504d0$58df0e70$@mcmaster.ca>
References: <5231C3E3.3050007@yorku.ca> <5231FBD9.6050802@gmail.com>
	<523305BB.7090802@yorku.ca> <52331857.8090904@gmail.com>
	<004801ceb09c$72f504d0$58df0e70$@mcmaster.ca>
Message-ID: <20130913175237.GA10588@calhounpc.econ.iastate.edu>

John Fox: (12:15PM on Fri, Sep 13)
[...cut...]
>I think that most users --
>as opposed to R developers -- will find the package::function( ... ) syntax
>in examples not so much ugly as cryptic. I think that we have ample recent
>evidence on this list that even developers (I don't exempt myself) are
>confused by namespace issues. On balance, I prefer
>
>	if (require(MASS)) {
>		loglm( ...)
>	}
>
>which tells the user that it's necessary to load MASS before using loglm().
>
>It would be nice if examples ran in a "sandbox," so that an example could
>read something like
>
>	library(MASS)
>	loglm( ... )
>	. . .
>
>without affecting the path in the current session, and fail gracefully if
>the MASS package weren't available (unlikely, of course, in the case of
>MASS, but not more generally).

Does assigning

     loglm <- MASS::loglm
     loglm( ... )

not work in examples anymore? (with MASS listed under 'Suggests'.)
That seems like it could address both concerns, but it would mask
loglm if it were already defined.

-- 
Gray Calhoun, Assistant Professor of Economics at Iowa State 
http://gray.clhn.co // (515) 294-6271 // 467 Heady Hall



[Rd] declaring package dependencies
Gray Calhoun