[R] package argument to library as string

David Brahm brahm at alum.mit.edu
Thu Nov 29 16:48:30 CET 2001


As seen in Dave Kane's question and my response, one needs the "character.only"
argument to library() in order to make a loop like this work:
R> for (i in rlibs) library(i, character.only=TRUE)

It seems like a similar option would be useful for detach():
R> for (i in rlibs) detach(paste("package",i,sep=":"))  # FAILS!
and any other functions which immediately run substitute() on their arguments.
-- 
                              -- David Brahm (brahm at alum.mit.edu)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list