Installing packages using methods: was Re: setGeneric(); R CMD check
John Chambers
jmc@research.bell-labs.com
Wed, 11 Sep 2002 09:57:04 -0400
John Chambers wrote:
................
>
> The following snippet will _apparently_ install with or without --save:
>
> ### Dummy Package
> require("methods")
>
> foo <- function(x)x
>
> setGeneric("foo")
>
> setMethod("foo", "character", function(x) paste("++", x))
> ###
>
By the way, an additional annoyance is that even with --SAVE, this
doesn't quite work always, because the `require("methods")' is only
active at INSTALL time, not when the image is loaded. It would be nice
to make this carry over automatically as well, but how?
For now, the programmer needs to include the require("methods") in a
First.lib function in the package.
John
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > 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
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
> --
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._