[R] R_USER - in which file should I include it?

Eduardo M. A. M.Mendes emammendes at gmail.com
Tue Sep 9 15:14:14 CEST 2008


Hello

Many thanks.  It works just fine.

How about the packages issue?  That is, same thing for the installation
path.

Cheers

Ed


-----Original Message-----
From: Gabor Grothendieck [mailto:ggrothendieck at gmail.com] 
Sent: Monday, September 08, 2008 10:01 PM
To: Eduardo M. A. M.Mendes
Cc: r-help at r-project.org
Subject: Re: [R] R_USER - in which file should I include it?

Try adding this at the end of your etc/Rprofile.site file.  That file
should already be there so you don't have to create it,
just edit it.

cat("Hello from Rprofile.site\n")
setwd("C:/Users/eduardo/Documents")

You may need to edit it as Administrator.   You should
see the Hello message in which case you will know that the
Rprofile.site file is being run.

That should work unless Tinn-R runs R in such a way as to
ignore Rprofile.site.

On Mon, Sep 8, 2008 at 8:11 PM, Eduardo M. A. M.Mendes
<emammendes at gmail.com> wrote:
> Hello
>
> I am not sure whether R starts from the same dir.  For instance:
>
> a) if I double-click on R-2.7.2 icon and then issue the command getwd(),
the
> result is:
>
>> getwd()
> [1] "C:/Users/eduardo/Documents"
>
> b) If R starts from within Tinn-R, the result is:
>
> getwd()
> [1] "C:/Program Files/R/R-2/bin"
>
> I want that no matter which calling R method I am using if I issue the
> command getwd() (first command) the result is:
>
> "C:/Users/eduardo/Documents/R"
>
>
> Moreover all new packages go to "C:/Users/eduardo/Documents/R/win-library"
>
>
> Thanks
>
> Ed
>
> -----Original Message-----
> From: Gabor Grothendieck [mailto:ggrothendieck at gmail.com]
> Sent: Monday, September 08, 2008 8:57 PM
> To: Eduardo M. A. M.Mendes
> Cc: r-help at r-project.org
> Subject: Re: [R] R_USER - in which file should I include it?
>
> Could you explain more clearly what you mean by "the same"?
> Do you mean that each time you click on R 2.7.2 icon on your
> desktop that running this from the R console:
>
> getwd()
>
> is the same directory on each startup?  Isn't that already the case?
> I don't think you need to set any environment variables at all.  If
> you don't set
> any environment variables then what specifically is happening that
> you don't want to happen?
>
> On Mon, Sep 8, 2008 at 7:10 PM, Eduardo M. A. M.Mendes
> <emammendes at gmail.com> wrote:
>> Hello
>>
>> I am a newbie.  I had my R upgraded from 2.7.1 to 2.7.2 and in doing so I
>> decided to install all 2.7 versions under c:\program files\R\2.7 from now
>> on (2.7.1 is located under .\2.7.1)
>>
>> Although I don't like the idea (I am running Vista), I have edited
>> etc\Renviron.site to contain:
>>
>>
>> R_USER=c:/Users/eduardo/Documents/R
>> R_LIBS_USER=c:/Users/eduardo/Documents/R/win-library/2.7
>>
>> As far as R starting always from the same location, that is,
>> c:/Users/eduardo/Documents/R, etc\Renviron.site didn't help.  So I wonder
>> whether someone from the list could help me to:
>>
>> a) force R to start always from the same location
>> b) force R to install all new packages in the same location
>>
>>
>> Many thanks
>>
>> Ed
>>
>> PS. Before sending this email, I read windows FAQ and browsed the
archives
>> (too many posts in the subject!).
>>
>> ______________________________________________
>> 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.
>>
>
>



More information about the R-help mailing list