Skip to content

Rprofile.site under Windows 7?

10 messages · Spencer Graves, Joshua Wiley, Duncan Murdoch +1 more

#
Hello All:


	  I'm still unable to get Rprofile.site to set, e.g., 
options(max.print=222), as I did with previous versions of R.


	  I just found similar questions posed by Trevor Miles and Ross Bowden 
with replies by Uwe Ligges and Duncan Murdoch.


	  In addition to the things I tried documented below, I also copied 
Rprofile.site into "R_HOME/etc/i386" and "R_HOME/etc/x64", without, 
e.g., max.print being changed to 222 as requested.


	  Any other suggestions?


	  Thanks,
	  Spencer Graves


################################################


       I have so far failed to get Rprofile.site to be processed in R 
2.15.0 under Windows 7 as I remember having done it in previous version 
of R.  For example, I've included "options(max.print=222)" in 
"R_HOME/etc/Rprofile.site" (with and without the environmental variable 
R_HOME set to the install directory of R 2.15.0 in advanced system 
settings):  When I start R, I still get the default:


options('max.print')
$max.print
[1] 99999


       Suggestions?
       Thanks,
       Spencer
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.15.0

  
    
#
How are you using R?  Any special front ends that might be causing
this?  Can you try it in unsuffered consequences?

Josh

On Thu, May 3, 2012 at 9:07 PM, Spencer Graves
<spencer.graves at structuremonitoring.com> wrote:

  
    
#
On 5/3/2012 9:28 PM, Joshua Wiley wrote:
I'm running R 1.15.0;  sessionInfo() appears below.  I get this 
from Rgui i386 and x64 plus when calling Rterm x64 via GNU Emacs 23.3.1 
using ESS.


       Thanks for the question.  Spencer
#
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
#
On 5/4/2012 5:41 AM, Duncan Murdoch wrote:
Thanks very much.  It helped me isolate and solve the problem:


       I edited "Rprofile.site" in Emacs.  When I saved the edited 
version into the default, write protected location, Windows 7 apparently 
saved two copies:  the original and a hidden copy with my edits.  When I 
then reopen the file in Emacs, I see my edits.  However, when I open it 
with WordPad or try to read it as you just described, my edits do not 
appear.  Knowing this, I saved a copy to a non-protected location, 
edited it there, then copied the edited version back into the protected 
directories.  Now it works.  (I had previously avoided installing R in 
the default location since encountering problems with Vista.)


       This is almost enough to drive a person to join the "I hate 
MicroSoft" fan club.


       Spencer
#
On 12-05-04 7:40 PM, Spencer Graves wrote:
I think that would just confirm my membership in the "I hate Emacs" club.

Duncan Murdoch
#
On Fri, May 4, 2012 at 7:17 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
[snip]
I don't see how this is Emacs fault...
#
On 12-05-04 10:33 PM, Joshua Wiley wrote:
It claimed to save a file somewhere, but didn't.

Duncan Murdoch
#
On 5/4/2012 9:27 PM, Duncan Murdoch wrote:
The file was saved, because when I reopened it in Emacs, the 
changes were there.  Windows 7 created a phantom copy, which it 
delivered to Emacs when I clicked and dragged it to the Emacs icon on 
the task bar.  To fix the problem, I copied the file to a non-protected 
place, opened it and the other copy in Emacs, copied the changes from 
the phantom copy into the non-protected copy, then copied the 
non-protected, edited version into the protected, default R installation 
directory.  I had not encountered this problem earlier, because I 
usually install R in an unprotected location.  I got sloppy with R 
1.15.0 and accepted the default installation directory.


       Best Wishes,
       Spencer

  
    
16 days later
#
On Sat, May 5, 2012 at 1:18 AM, Spencer Graves
<spencer.graves at structuremonitoring.com> wrote:
Do you actually have multiple users on your PC accessing R?  If not,
you could avoid using the Rprofile.site file entirely and just put a
.Rprofile file having the same contents using the %userprofile% folder
for the user who uses R.  That would avoid the problem of writing into
system space.  Alternately save Rprofile.site as Adminstrator.