[R-SIG-Finance] Linux Commandline and Packages

Dirk Eddelbuettel edd at debian.org
Mon Oct 22 23:06:58 CEST 2012


On 22 October 2012 at 16:43, Ralph Vince wrote:
| I frequently use RKWard IDE. However, Ive been trying to run a script
| from the command line (in either Centos 6, or Ubuntu 10,10). I have
| all of my packages installed in ~/R/Packages, and am invoking
| ~/R/>R CMD BATCH ~/R/Work/myscript.R
| and, in doing so, it doesn't seem to find the installed packages ( in
| this case, quantmod and plan) as seen in the output:
| How do I get the comandline to recognize my installed packages?

One way is to use a file ~/.Rprofile where you can have commands:

   ## add local library path
  .libPaths(c("~/R/Packages", .libPaths()))

which prepends the path to the default settings.

See help(Startup) for more alomgh tjese lines.

| Thanks, Ralph VInce
| R version 2.11.1 (2010-05-31)

That is very dated. You may miss a number of recent / relevant packages.

Hth, Dirk

| Copyright (C) 2010 The R Foundation for Statistical Computing
| ISBN 3-900051-07-0
| R is free software and comes with ABSOLUTELY NO WARRANTY.
| You are welcome to redistribute it under certain conditions.
| Type 'license()' or 'licence()' for distribution details.
|   Natural language support but running in an English locale
| R is a collaborative project with many contributors.
| Type 'contributors()' for more information and
| 'citation()' on how to cite R or R packages in publications.
| Type 'demo()' for some demos, 'help()' for on-line help, or
| 'help.start()' for an HTML browser interface to help.
| Type 'q()' to quit R.
| [Previously saved workspace restored]
| > require(quantmod)
| Loading required package: quantmod
| Warning message:
| In library(package, lib.loc = lib.loc, character.only = TRUE,
| logical.return = TRUE,  :
|   there is no package called 'quantmod'
| > library(plan)
| Error in library(plan) : there is no package called 'plan'
| Execution halted
| _______________________________________________
| R-SIG-Finance at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-sig-finance
| -- Subscriber-posting only. If you want to post, subscribe first.
| -- Also note that this is not the r-help list where general R questions should go.

Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com

More information about the R-SIG-Finance mailing list