[R] How to specify an addition Rprofile file for Rscript in the command line?
2
0
Entering edit mode
Peng Yu ▴ 940
@peng-yu-3586
Last seen 9.6 years ago
Is there a cleaner way that I can supply an addition Rprofile from the command line? Regards, Peng On Tue, Aug 11, 2009 at 11:27 AM, Charlie Sharpsteen<chuck at="" sharpsteen.net=""> wrote: > A quick and dirty way would be to add the following line to the beginning of > your scripts: > > source( '/path/to/additional/Rprofile' ) > > -Charlie > On Tue, Aug 11, 2009 at 9:41 AM, Peng Yu <pengyu.ut at="" gmail.com=""> wrote: >> >> Hi, >> >> When I use Rscript, I want that it load an additional Rprofile file >> besides the default ones. I don't find such an option. Can somebody >> let me know if there is such an option? >> >> Regards, >> Peng >> >> ______________________________________________ >> R-help at 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. > >
• 2.8k views
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 14 months ago
United States
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
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Tue, Aug 11, 2009 at 9:22 PM, Peng Yu<pengyu.ut at="" gmail.com=""> wrote: > Is there a cleaner way that I can supply an addition Rprofile from the > command line? Hi, Peng. You might want to check out this: http://watson.nci.nih.gov/cran_mirror/doc/manuals/R-intro.html #Customizing-the-environment R doesn't allow exactly what you are asking, I do not think, but there is quite a bit of flexibility. If none of these options suits your needs, you might want to write to the R-help list with exactly what you are trying to do. Sean > On Tue, Aug 11, 2009 at 11:27 AM, Charlie > Sharpsteen<chuck at="" sharpsteen.net=""> wrote: >> A quick and dirty way would be to add the following line to the beginning of >> your scripts: >> >> source( '/path/to/additional/Rprofile' ) >> >> -Charlie >> On Tue, Aug 11, 2009 at 9:41 AM, Peng Yu <pengyu.ut at="" gmail.com=""> wrote: >>> >>> Hi, >>> >>> When I use Rscript, I want that it load an additional Rprofile file >>> besides the default ones. I don't find such an option. Can somebody >>> let me know if there is such an option? >>> >>> Regards, >>> Peng >>> >>> ______________________________________________ >>> R-help at 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. >> >> > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENT

Login before adding your answer.

Traffic: 738 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6