[BioC] [R] How to specify an addition Rprofile file for Rscript in the command line?

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Aug 12 03:34:23 CEST 2009


Hi,

On Aug 11, 2009, at 9:22 PM, Peng Yu wrote:

> Is there a cleaner way that I can supply an addition Rprofile from the
> command line?

I'm not sure if this will work, but if you look at the second  
paragraph of Rprofile:

?Rprofile

... R searches for the site-wide startup profile unless the command  
line option --no-site-file was given. The name of this file is taken  
from the value of the R_PROFILE environment variable...

So how about setting that path to your new/custom Rprofile file in  
your environment before you run Rscript, eg assuming you are using bash:

$ export R_PROFILE='/my/special/Rprofile'
$ Rscript blah.R

You can put your custom whatever-you-like in there. If you still want  
it to pull your Rprofile settings from a default Rprofile, like the  
one you might have in ~/.Rprofile, you can source that at the end of  
your custom Rprofile script.

Perhaps that'll do the trick.

-steve
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
  | Memorial Sloan-Kettering Cancer Center
  | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioconductor mailing list