[Rd] R_PROFILE on Windows

Fernando Henrique Ferraz P. da Rosa academic at feferraz.net
Tue Dec 13 19:16:20 CET 2005


  Dear R-devel,

        There seems to be a bug in the Startup section, regarding the
R_PROFILE environment variable in Windows. If not a bug in the Startup
itself, perhaps a bug in the documentation.

        According to ?Startup:

       Then 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. If this variable is unset, the default is
       '$R_HOME/etc/Rprofile.site'
        
        On Windows XP, I created a batch file with the following lines:

        SET R_PROFILE="C:\fernando\R.profile"
        "C:\progs\R-2.2.0\bin\Rgui.exe"
        
        On c:\fernando\R.profile I had:

        options(foo='bar')

        Running the batch file I created I get, in R:

        > options()$foo
        NULL
        >Sys.getenv("R_PROFILE")
                           R_PROFILE 
        "\"c:\\fernando\\R.profile\"" 
               
        I've tried using slashes instead of backslashes
(fernando/R.profile), double blackslashes (fernando\\R.profile) but it
seems there's no way to make it work.

        The only way I could manage to have R read the profile was
renaming R.profile to .Rprofile and starting R on the directory the
.Rprofile was located.

        Is this really the intended behaviour? If so, what's the
correct way to specify the R_PROFILE variable and have R use it on
Windows?

        Ps: I've tested it on R 2.2.0 and on r-devel r36675, on Windows
XP SP2. Sorry if this is a non-bug. I'm a poor linux user trying to
survive on Windows, so I might have overloooked something.

        Thank you, 




--
"Though this be randomness, yet there is structure in't."
                                           Rosa, F.H.F.P

Instituto de Matemática e Estatística
Universidade de São Paulo
Fernando Henrique Ferraz P. da Rosa
http://www.feferraz.net



More information about the R-devel mailing list