[R] .Rprofile under Windoze.

Duncan Murdoch murdoch at stats.uwo.ca
Thu Aug 31 02:01:38 CEST 2006


On 8/30/2006 5:49 PM, Rolf Turner wrote:
> I am (for my sins) having to do some work using R under Windoze.  I
> wanted to set up a .Rprofile to control my set-up.  The docs on
> .Rprofile say that it can/should be placed in ``the user's home
> directory''.  ``An Introduction to R'' observes lucidly that this
> concept needs to be clarified under Windoze.
> 
> Following the suggestions in An Introduction to R, I tried
> putting a .Rprofile in
> 
> 	"C:\Documents and Settings\rolf\My Documents"

That's probably the right place.  You can confirm in the R Edit|GUI 
preferences dialog:  it defaults to trying to save or load from the same 
place it would look for .Rprofile.

> 
> When that didn't work, I tried putting it in the starting directory
> (and confirmed that I'd got that right by checking with getwd() and
> list.files(all.files=TRUE) ).
> 
> The last invocation indicated that the name of the file was *really*
> ``.Rprofile.txt'' --- although I'd tried to save it as (simply)
> ``.Rprofile''.  Is that the problem?  If so, how can I persuade
> Windoze NOT to stick that damned .txt tag on the end?  

You can put it in double quotes.  It's really your editor doing this; 
most reasonable editors (but not the ones that come with Windows) are 
configurable to never add the extension.

Another change to Windows defaults that's essential to maintain sanity 
is to tell it to display full filenames, not to hide the .txt in the 
first place.  You do this in an Explorer window by clicking on 
"Tools|Folder options...|View|Hide extensions for known file types" 
(where each of the 4 components in that path is a different kind of 
interface element.  I love the rich Windows user interface!)

Duncan Murdoch

(Gawd, but I
> ***hate*** Windoze!!!)  If that's not the problem, can you suggest
> what *is* the problem?
> 
> All that .Rprofile(.txt) has in it at the moment is
> 
> 	options(prompt="Wheee! ")
> 
> so that I can easily tell whether it's working.  If I
> execute
> 
> 	> source(".Rprofile.txt")
> 
> the prompt does indeed get changed to ``Wheee! '' as it should.
> 
> I would appreciate enlightenment.  Ta.
> 
> 				cheers,
> 
> 					Rolf Turner
> 					rolf at math.unb.ca
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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