[Rd] Detaching "ctest"
Jonathan Rougier
J.C.Rougier@durham.ac.uk
Thu, 29 Mar 2001 14:38:57 +0100 (BST)
Hi Everyone,
We have just upgraded to R-1.2.1, and I note, in contrast to R-1.1.1, that
ctest is now loaded automatically. The mechanism for this is to create a
.First function in base:
.First <- function() {
require("ctest", quietly=TRUE)
}
Now I don't want ctest, but I find that simply putting
if (length(grep("ctest", search())))
detach(package:ctest)
into my ".Rprofile" does not work, for the simple reason that .First is
invoked after .Rprofile. I thought that one possible solution is to
remove .First from base, but when I tried this I got
> find(".First")
[1] "package:base"
> search()
[1] ".GlobalEnv" "package:ctest" "package:patches" "Autoloads"
[5] "package:base"
> remove(".First", pos=5)
Warning message:
remove: variable ".First" was not found
> remove(".First", inherits=TRUE)
Warning message:
remove: variable ".First" was not found
Is it not possible to remove things from "base"? The alternative is to
mask the .First with a blank one in my .Rprofile, but this seems rather
inelegant.
So my questions are:
(1) Why has ctest been included among the start-up options, and why has
this mechanism of using the .First been used, rather than relying on
people putting the command require("ctest", quietly=TRUE) into the
.Rprofile?
(2) Is there an elegant way of me stopping ctest from being loaded, other
then editing the Rprofile in R-1.2.1/lib/R/library/base/R/?
Many thanks, Jonathan.
Jonathan Rougier Science Laboratories
Department of Mathematical Sciences South Road
University of Durham Durham DH1 3LE
tel: +44 (0)191 374 2361, fax: +44 (0)191 374 7388
http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._