[R] set up directory for R when I start R

Earl F. Glynn efg at stowers-institute.org
Mon Dec 11 20:21:53 CET 2006


"Dieter Menne" <dieter.menne at menne-biomed.de> wrote in message 
news:loom.20061210T115836-859 at post.gmane.org...
> Aimin Yan <aiminy <at> iastate.edu> writes:
>
>>
>> I want to set default directory for R when I start R.
>> How to do this?
>>
> ?setwd
>
> In Windows, I prefer the method described in
>
> http://tolstoy.newcastle.edu.au/R/help/00b/2454.html

I learned a similar trick by using Regedit to set the registry keys 
directly.  (Years ago someone showed me this trick to start a DOS session). 
Apparently, either "\Directory\shell" or "\Folder\shell" do the same thing. 
Do you know if there is a difference?

I checked and your suggestion can be modified to even specify a http_proxy, 
if needed:

For example, this works for me under Windows XP, including the proxy server, 
from any directory chosen using Windows Explorer:

------------
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\R\command]
@="C:\\Program Files\\R\\R-2.4.0\\bin\\Rgui.exe 
http_proxy=http://proxy01:8080 http_proxy_user=ask"
-----------

The above was the exported registry key from what I set manually using 
RegEdit. I used simply "R" instead of "Run R", like you suggested.


efg

Earl F. Glynn
Bioinformatics
Stowers Institute for Medical Research




More information about the R-help mailing list