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" 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? (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
On 8/30/06, Rolf Turner <rolf at erdos.math.unb.ca> 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.Saving ".Rprofile" to the R root directory works for me. On my system that is "C:\Program Files\R\R-2.3.1\" jab -- John Bollinger, CFA, CMT www.BollingerBands.com If you advance far enough, you arrive at the beginning.
Under Windows mine is located here C:\Program Files\R\R-2.3.1\library\base\R The file name, however is not .Rprofile, but rather Rprofile Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Rolf Turner Sent: Wednesday, August 30, 2006 5:50 PM To: r-help at stat.math.ethz.ch Subject: [R] .Rprofile under Windoze. 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" 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? (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.
And... If you have/use shortcuts to R, you may also save an ".Rprofile" to whatever directory you name in the "Start in:" field of the shortcut. This allows one to have many profiles. jab -- John Bollinger, CFA, CMT www.BollingerBands.com If you advance far enough, you arrive at the beginning.
> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch [mailto:r-help- > bounces at stat.math.ethz.ch] On Behalf Of Rolf Turner > Sent: Wednesday, August 30, 2006 2:50 PM > To: r-help at stat.math.ethz.ch > Subject: [R] .Rprofile under Windoze. > > 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" > > 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? (Gawd, but I > ***hate*** Windoze!!!) If that's not the problem, can you suggest > what *is* the problem? ><<<snip>>> Rolf, Whether an extension is automagically added (and if so what) is usually a function of the program writing the file out. In MS Windows programs, there is usually an option in the Save/SaveAs menu called something like "Save As Type". To save without an extension you want to make sure that the value is 'All Files (*.*)', otherwise the program will usually tag on a default extension. Hope this is helpful, Dan Daniel J. Nordlund Research and Data Analysis Washington State Department of Social and Health Services Olympia, WA 98504-5204
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.
Rolf> 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?The easiest way is to use a smarter editor. Emacs is perfectly happy to name a file .Rprofile and wouldn't dream of appending an extension to the filename that you specify. Rich
Hi or you can change Rprofile.site in etc directory to whatever startup commands you want to execute to have the same profile in all sessions. HTH Petr On 30 Aug 2006 at 15:11, BBands wrote: Date sent: Wed, 30 Aug 2006 15:11:35 -0700 From: BBands <bbands at gmail.com> To: r-help at stat.math.ethz.ch Subject: Re: [R] .Rprofile under Windoze.> And... If you have/use shortcuts to R, you may also save an > ".Rprofile" to whatever directory you name in the "Start in:" field of > the shortcut. This allows one to have many profiles. > > jab > -- > John Bollinger, CFA, CMT > www.BollingerBands.com > > If you advance far enough, you arrive at the beginning. > > ______________________________________________ > 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.Petr Pikal petr.pikal at precheza.cz
On Thu, 31 Aug 2006, Petr Pikal wrote:> Hi > > or you can change > > Rprofile.site in etc directory to whatever startup commands you want > to execute to have the same profile in all sessions.Please see the warning about this in ?Startup: it is not the same thing as putting .Rprofile in your home directory. Also, many users will not have write permission on R_HOME/etc.> On 30 Aug 2006 at 15:11, BBands wrote: > > > And... If you have/use shortcuts to R, you may also save an > > ".Rprofile" to whatever directory you name in the "Start in:" field of > > the shortcut. This allows one to have many profiles.-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi Well I see your point, but let say I would like to load some of my functions, libraries I use, some dataset, and set the lattice theme to my preferred version. As I work on different problems and each problem has its separate directory I used to copy .Rprofile from one directory to another, but recently I find more convenient just to copy my Rprofile.site from one version of R to newly installed. Then I am sure I have always the same startup regardless of problem I am working on. Am I wrong? Is there some other recommended way? Although I do not have write permission to registry and to some of root directories, thank goodness (and Rcore development team :-), I am able to install R elsewhere and use it without some sophisticated hacking. Best regards Petr Pikal On 31 Aug 2006 at 7:50, Prof Brian Ripley wrote: Date sent: Thu, 31 Aug 2006 07:50:44 +0100 (BST) From: Prof Brian Ripley <ripley at stats.ox.ac.uk> To: Petr Pikal <petr.pikal at precheza.cz> Copies to: r-help at stat.math.ethz.ch Subject: Re: [R] .Rprofile under Windoze.> On Thu, 31 Aug 2006, Petr Pikal wrote: > > > Hi > > > > or you can change > > > > Rprofile.site in etc directory to whatever startup commands you want > > to execute to have the same profile in all sessions. > > Please see the warning about this in ?Startup: it is not the same > thing as putting .Rprofile in your home directory. > > Also, many users will not have write permission on R_HOME/etc. > > > > On 30 Aug 2006 at 15:11, BBands wrote: > > > > > And... If you have/use shortcuts to R, you may also save an > > > ".Rprofile" to whatever directory you name in the "Start in:" > > > field of the shortcut. This allows one to have many profiles. > > -- > Brian D. Ripley, ripley at stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) 1 South > Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, > UK Fax: +44 1865 272595 > > ______________________________________________ > 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.Petr Pikal petr.pikal at precheza.cz
On Thu, 31 Aug 2006, Petr Pikal wrote:> Hi > > Well I see your point, but let say I would like to load some of my > functions, libraries I use, some dataset, and set the lattice theme > to my preferred version. > > As I work on different problems and each problem has its separate > directory I used to copy .Rprofile from one directory to another, but > recently I find more convenient just to copy my Rprofile.site from > one version of R to newly installed. Then I am sure I have always the > same startup regardless of problem I am working on. Am I wrong? Is > there some other recommended way?I use a .Rprofile in home directory (only): works in all startup directories and all versions of R (which matters to me as I am forever rebuilding R from scratch).> Although I do not have write permission to registry and to some of > root directories, thank goodness (and Rcore development team :-), I > am able to install R elsewhere and use it without some sophisticated > hacking. > > Best regards > Petr Pikal > > > On 31 Aug 2006 at 7:50, Prof Brian Ripley wrote: > > Date sent: Thu, 31 Aug 2006 07:50:44 +0100 (BST) > From: Prof Brian Ripley <ripley at stats.ox.ac.uk> > To: Petr Pikal <petr.pikal at precheza.cz> > Copies to: r-help at stat.math.ethz.ch > Subject: Re: [R] .Rprofile under Windoze. > > > On Thu, 31 Aug 2006, Petr Pikal wrote: > > > > > Hi > > > > > > or you can change > > > > > > Rprofile.site in etc directory to whatever startup commands you want > > > to execute to have the same profile in all sessions. > > > > Please see the warning about this in ?Startup: it is not the same > > thing as putting .Rprofile in your home directory. > > > > Also, many users will not have write permission on R_HOME/etc. > > > > > > > On 30 Aug 2006 at 15:11, BBands wrote: > > > > > > > And... If you have/use shortcuts to R, you may also save an > > > > ".Rprofile" to whatever directory you name in the "Start in:" > > > > field of the shortcut. This allows one to have many profiles. > > > > -- > > Brian D. Ripley, ripley at stats.ox.ac.uk > > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > > University of Oxford, Tel: +44 1865 272861 (self) 1 South > > Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, > > UK Fax: +44 1865 272595 > > > > ______________________________________________ > > 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. > > Petr Pikal > petr.pikal at precheza.cz >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595