[R] Quick advice on loading packages

jwd jwd at surewest.net
Tue Oct 22 09:27:53 CEST 2013


On Mon, 21 Oct 2013 19:32:17 -0400
"Data Analytics Corp." <walt at dataanalyticscorp.com> wrote:

> Hi,
> 
> I need some quick advice/help on loading packages.  I want to write a 
> simple function to load a number of packages I intend to use at a 
> conference presentation.  I'm thinking of something like:
> 
>              fn.install <- function(){install.packages(c("ggplot2", 
> "scales"),  repos = "c:\\temp")}
> 
> There will be many more than just the two I listed.  All the zip
> files are in a Windows directory c:\temp.  Will this work?
> 
> Thanks,
> 
> Walt
> 
Just use a short script.  Install R, install the packages.  To load
them, write a short script, e.g.

#Sets working directory and loads essential libraries.
setwd([working directory here])
library(MASS, aplpack, cclust, ggplot, ...)

Call that from R and provided you have everything where you've R it
was, you're set.

JWDougherty



More information about the R-help mailing list