Installing packages using methods: was Re: setGeneric(); R CMD check

David James dj@research.bell-labs.com
Wed, 11 Sep 2002 12:42:56 -0400


John, 

Thanks for the solution.

Your suggestion seems to work quite nicely and the added paragraphs
to help(INSTALL) are clear.  However, it seems that most people will
not be aware of this issue, and if and when they stumble into it,
looking at ?INSTALL may not be their first thought.  I'm wondering
if it would be helpful to include a similar description (or point to
?INSTALL) in, say, "Writing R Extensions", and/or ?setMethod, etc.?
A line in the Release Notes may also be helpful?

--
David

John Chambers wrote:
> Just to wrap up this thread, for now.
> 
> A section has been added to ?INSTALL with hints on installing packages
> that use the methods package:
> 
>      Packages that require the methods package, and that use functions
>      such as `setMethod' or `setClass', should be installed by creating
>      a binary image.
> 
>      The package should require the methods package, both during
>      installation and when the user attaches the package.  A good
>      solution for most cases is to include the line
>      `require("methods")' twice, once at the beginning of the package's
>      R source, and once in the file `install.R' in the package
>      directory (the top-level directory, not in the `R' directory below
>      that).  The `install.R' file causes an image to be saved, and the
>      contents will ensure that methods are available when the package
>      is attached.
> 
> The suggestions seem to work, at least on some simple tests.  I'm not
> aware of situations where this fails, but let me know otherwise.
> 
> The documentation should be in the next beta or rsync,  also in the
> windows INSTALL help file (but I don't have a way to test that), plus a
> pointer in the R-exts document to the online help page.
> 
> John
> -- 
> John M. Chambers                  jmc@bell-labs.com
> Bell Labs, Lucent Technologies    office: (908)582-2681
> 700 Mountain Avenue, Room 2C-282  fax:    (908)582-3340
> Murray Hill, NJ  07974            web: http://www.cs.bell-labs.com/~jmc
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
David A. James
Statistics Research, Room 2C-253            Phone:  (908) 582-3082       
Bell Labs, Lucent Technologies              Fax:    (908) 582-3340
Murray Hill, NJ 09794-0636
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._