After reading the help files (?Startup) and using RSiteSearch("defaultPackages"), I have been trying to add several packages to my default startup list using the following code: local({ old<-getOption("defaultPackages") options(defaultPackages=c(old,"lattice","RODBC") }) Subsequently, when I query the default list using: getOption("defaultPackages") the list of packages I have added appears along with the standard defaults. However, when I restart R, none of these packages are loaded and they don't appear in the default list when it is queried again. There's probably something simple I am missing and I am hoping that someone will (politely) point out where I've messed up. I am running R 2.4.0 on a Windows 2000 PC. Sys.getenv("R_USER") returns the location of my Rconsole in the "...My Documents" file, but my working directory is in the "...program files/R/R-2.4.0" directory, if that helps. Thanks for your assistance. Jeff-- ==================================================Dr. Jeffrey J. Lusk Upland Game Program Manager Nebraska Game & Parks Commission, Wildlife Division 2200 N. 33rd Street Lincoln, NE 68506 e-mail: jeff.lusk@ngpc.ne.gov [mailto:jeff.lusk@ngpc.ne.gov] Web: http://www.geocities.com/jefflusk2002 [http://www.geocities.com/jefflusk2002] Web: http://www.OutdoorNebraska.org [http://www.outdoornebraska.org/] Phone: (402) 471-1756 ================================================== [[alternative HTML version deleted]]
Prof Brian Ripley
2007-Mar-28 14:49 UTC
[R] Problem with adding packages to default start-up list
On Wed, 28 Mar 2007, Jeff Lusk wrote:> After reading the help files (?Startup) and using > RSiteSearch("defaultPackages"), I have been trying to add several packages > to my default startup list using the following code: > > local({ > old<-getOption("defaultPackages") > options(defaultPackages=c(old,"lattice","RODBC") > })Where did you put this code? It has a syntax error in the third line, which might be the issue (and whether you get an error depends on where you put it). Once that is corrected this works for me in ~/.Rprofile.> > Subsequently, when I query the default list using: > > getOption("defaultPackages") > > the list of packages I have added appears along with the standard defaults. > However, when I restart R, none of these packages are loaded and they don't > appear in the default list when it is queried again. There's probably > something simple I am missing and I am hoping that someone will (politely) > point out where I've messed up. > > I am running R 2.4.0 on a Windows 2000 PC. Sys.getenv("R_USER") returns the > location of my Rconsole in the "...My Documents" file, but my working > directory is in the "...program files/R/R-2.4.0" directory, if that helps. > > Thanks for your assistance. > > Jeff-- > > > ==================================================> Dr. Jeffrey J. Lusk > Upland Game Program Manager > Nebraska Game & Parks Commission, Wildlife Division > 2200 N. 33rd Street > Lincoln, NE 68506 > e-mail: jeff.lusk at ngpc.ne.gov [mailto:jeff.lusk at ngpc.ne.gov] > Web: http://www.geocities.com/jefflusk2002 > [http://www.geocities.com/jefflusk2002] > Web: http://www.OutdoorNebraska.org [http://www.outdoornebraska.org/] > > Phone: (402) 471-1756 > ==================================================> > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >-- Brian D. Ripley, ripley at 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595