From dj@research.bell-labs.com  Wed Sep 11 17:42:56 2002
From: dj@research.bell-labs.com (David James)
Date: Wed, 11 Sep 2002 12:42:56 -0400
Subject: Installing packages using methods: was Re: setGeneric(); R CMD check
In-Reply-To: <3D7F67BE.7E76ADF@research.bell-labs.com>; from jmc@research.bell-labs.com on Wed, Sep 11, 2002 at 11:56:46AM -0400
References: <20020910150946.B2319@jessie.research.bell-labs.com> <3D7F4948.B0689BCC@research.bell-labs.com> <3D7F4BB0.E724BD5F@research.bell-labs.com> <3D7F67BE.7E76ADF@research.bell-labs.com>
Message-ID: <20020911124256.A825@jessie.research.bell-labs.com>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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