Skip to content
Prev 51833 / 63421 Next

S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment

On Tue, Apr 19, 2016 at 9:21 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
Slightly weaker version of this wish (that would also remove
confusion): At least make R and Rscript load the same set of packages
by default.


More clarification (in case some is new to this topic):

The packages loaded by default when R and Rscript is loaded can be
controlled by environment variable 'R_DEFAULT_PACKAGES' and/or option
'defaultPackages', cf. help("Startup").  When this is empty or
undefined, the built-in defaults kick in, and it's these built-in
defaults that differ between the R and the Rscript executable:

$ R --quiet --vanilla -e "getOption('defaultPackages')"
[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"

$ Rscript --vanilla -e "getOption('defaultPackages')"
[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"

Thus, a user can enforce the same set of default packages by using:

$ export R_DEFAULT_PACKAGES=datasets,utils,grDevices,graphics,stats,methods

$ R --quiet --vanilla -e "getOption('defaultPackages')"
[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"

$ Rscript --vanilla -e "getOption('defaultPackages')"
[1] "datasets"  "utils"     "grDevices" "graphics"  "stats"     "methods"

/Henrik

Thread (13 messages)

Kirill Müller S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 18 Kirill Müller S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 18 Michael Lawrence S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 18 Kirill Müller S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 18 Michael Lawrence S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Gabriel Becker S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Michael Lawrence S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Gabriel Becker S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Hadley Wickham S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Henrik Bengtsson S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Dirk Eddelbuettel S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Michael Lawrence S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 19 Martin Maechler S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment Apr 20