Skip to content
Prev 293562 / 398503 Next

Rprofile.site under Windows 7?

On 12-05-04 12:41 AM, Spencer Graves wrote:
I can see three possibilities:

  1.  You have more than one Rprofile.site, and it's not reading the one 
you think it's reading.   The search order is:
   - the file mentioned in the R_PROFILE environment variable if there 
is one
   - RHOME/etc/<arch>/Rprofile.site
   - RHOME/etc/Rprofile.site

It takes the first of those and ignores later ones.

<arch> is either i386 or x64, depending on your architecture.

2.  You don't have permission to read the file.  Does readLines() read 
it from within a session?  This code is somewhat like what R does on 
startup:

   env <- Sys.getenv("R_PROFILE")
   if (nchar(env))
     readLines(env)
   else {
     filename <- file.path(R.home(), "etc", sub("[/]", "", 
Sys.getenv("R_ARCH")), "Rprofile.site")
     if (file.exists(filename))
       readLines(filename)
     else {
       filename <- file.path(R.home(), "etc", "Rprofile.site")
       if (file.exists(filename))
         readLines(filename)
     }
   }

Does it work for you?

3.  There's a bug somewhere....

Duncan Murdoch