(PR#1715) Re: package `methods' has persistent effects even if detached

Prof Brian D Ripley ripley@stats.ox.ac.uk
Fri, 28 Jun 2002 09:28:57 +0100 (BST)


Sorry, forgot to say this is in R-devel (2002-06-27) but not in 1.5.1.

> class
.Primitive("class")
> find("class")
[1] "package:base"
> library(methods)
> class
.Primitive("dataClass")
> find("class")
[1] "package:methods" "package:base"
> get("class", "package:base")
.Primitive("dataClass")
> detach("package:methods")
> class
.Primitive("dataClass")

so attaching methods is altering the class object *in base*.
Related to namespaces?

On Fri, 28 Jun 2002 ripley@stats.ox.ac.uk wrote:

> This came from an error in reg-tests-1.R
>
> > x <- as.data.frame(x=I("C"))[[1]]
> > class(x)
> [1] "AsIs"
> > library(methods)
> > detach("package:methods")
> > search()
> [1] ".GlobalEnv"    "package:ctest" "Autoloads"     "package:base"
> > x <- as.data.frame(x=I("C"))[[1]]
> > class(x)
> [1] "AsIs"      "character"
>
> My reading is that this should not happen.
>
> --
> Brian D. Ripley,                  ripley@stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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