[R] Rprofile.site under Windows 7?

Spencer Graves spencer.graves at structuremonitoring.com
Sat May 5 01:40:58 CEST 2012


On 5/4/2012 5:41 AM, Duncan Murdoch wrote:
> On 12-05-04 12:41 AM, Spencer Graves wrote:
>> On 5/3/2012 9:28 PM, Joshua Wiley wrote:
>>> How are you using R?  Any special front ends that might be causing
>>> this?  Can you try it in unsuffered consequences?
>>
>>
>>         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.
>
> 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?


       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

>
> 3.  There's a bug somewhere....
>
> Duncan Murdoch
>
>>
>>
>>         Thanks for the question.  Spencer
>>>
>>> Josh
>>>
>>> On Thu, May 3, 2012 at 9:07 PM, Spencer Graves
>>> <spencer.graves at structuremonitoring.com>   wrote:
>>>> 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
>>>>
>>>>
>>>>> sessionInfo()
>>>> 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
>>>>
>>>>
>>>> ______________________________________________
>>>> 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.
>>
>> ______________________________________________
>> 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