On Aug 20, 2010, at 3:25 PM, Eva Nordstrom wrote:
I am using R 2.11.1 in a Microsoft Windows environment. Is there a
way to load a
package (e.g. the zoo package) using only "written code", not menus
or mouse
clicks?
The "code" below code brings up the "Select One" [package] menu. I
just want to
automatically load the "zoo package".
local({pkg <- select.list(sort(.packages(all.available =
TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
what's wrong with:
require(zoo) #?
I suppose you could do something fancier like:
stopifnot(require(zoo)) ... but I don't think that adds any benefit.
--
David
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.