Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Alex Gutteridge
RE: Rprofile [ reply ]  
2008-05-02 09:50
Ok, I understand. I'll take another look at the R embedding API and see if there are options to load these files by default.

By: Yeray M
RE: Rprofile [ reply ]  
2008-05-02 08:36
Tans Alex but maybe I didn't explained well my doubt.

R lets you define your own environment in some files which it loads when you start a session. I have defined a system wide environment definition with my set of functions in <b>/usr/lib/R/etc/Rprofile.site</b>.

<b>R loads this file</b> when every user start an R session, but when I get an instance of R <b>with RSRuby, this file isn't loaded</b>.

I'm wondering if RSRuby starts a real R session (in which case this should be a bug) or this functionality it's not supported and every user should load manually the environment definiton.

thanks again

By: Alex Gutteridge
RE: Rprofile [ reply ]  
2008-04-30 16:57
Hi,

Using the 'source' function seems to work fine for me:

[alexg@powerbook]/Users/alexg(4): cat .Rprofile
plus <- function(x,y){
x+y
}
[alexg@powerbook]/Users/alexg(5): ruby -rubygems -e 'require "rsruby"; RSRuby.instance.source("~/.Rprofile");puts RSRuby.instance.plus(1,2)'
3

Does that help?

By: Yeray M
Rprofile [ reply ]  
2008-04-30 15:46
Hi, I'm using R 2.1.0 (2005-04-18) on debian sarge with rsruby-0.4.5

I want to know if RSRuby.instance can load Rprofile.site environment definition file (or ~/.Rprofile)

I've tried but it seems like RSRuby.instance doesn't know any functions I define there.

Does anybody tried this before? Any results?