[R-SIG-Mac] R.app intractable history problem
Loren Engrav
engrav at u.washington.edu
Wed Nov 4 18:28:55 CET 2009
I also found the R.app management of .Rhistory difficult to understand
Finally gave up trying to understand and did this
In 64 bit R on Mac Pro
Checked Read history file on startup
Then entered ~/.engravRhistory in the R history file: AND HIT RETURN
(whole things fails if you do not hit return)
Checked Cleanup history entries
Now have visible file called engravRhistory.Rhistory in home folder and
history loads Ok at startup
Is not pretty but am no longer fiddling with history file and losing command
history
Then in 32 bit on MacBook Pro
Did same thing but here the file is named .engravRhistory and is invisible,
but still works
The "hit return" after entering the path/name might be what you are missing
All assuming you have done nothing with .Rprofile
> From: Rob Goedman <robjgoedman at me.com>
> Date: Wed, 04 Nov 2009 07:05:39 -0800
> To: vi <vishyiyer at gmail.com>
> Cc: "r-sig-mac at stat.math.ethz.ch" <r-sig-mac at stat.math.ethz.ch>
> Subject: Re: [R-SIG-Mac] R.app intractable history problem
>
> Hi Vi,
>
> Is there anything in your in your .Rprofile, .First or .Last?
>
> Another quick suggestion, can you try with e.g. .myRhistory, so
> changing the last part of the path name?
>
> I'm assuming the 'Read history file on startup' item is checked in the
> Startup preferences panel.
>
> Thanks,
> Rob
>
>
> On Nov 3, 2009, at 6:20 PM, vi wrote:
>
>> I have seen this asked before and read the threads but cannot find a
>> clear answer to this problem.
>>
>> I cannot manage to get the history to work from R.app. I am running R
>> version 2.9.0 on an iMac OSX 10.5.8 (Leopard). I've tried
>>
>> 1. Using default paths and names for startup (~) and history file
>> (.Rhistory). Run R.app by clicking on the dock, run a few commands. If
>> I save workspace, it writes ~/.Rhistory but that file is always blank.
>> Next session of R.app there is no history available of course. (If I
>> don't save workspace on exit, it does not write a ~/.Rhistory file at
>> all. Is this normal?)
>>
>> 2. Changing startup path but using the same name for history file (~/
>> xxx/yyy/.Rhistory). I read my problem could be that R writes to the
>> default location after R.app exits, so it could therefore be empty. I
>> change the path in the Preferences->Startup-> Initial working
>> directory (~/xxx/yyy/) and then the R history file in pref. to /Users/
>> myname/xxx/yyy/.Rhistory and hit return before clicking anywhere else.
>> It automatically changes it to ~/xxx/yyy/.Rhistory so it apparently
>> recognizes my change. Then I enter a few commands in R and quit.
>> Again, if I save workspace, it creates ~/xxx/yyy/.Rhistory but it's
>> always empty. If I don't save workspace, the specified history file is
>> not even created.
>>
>> 3. Changing startup path and trying to use a different name for
>> history file (~/xxx/yyy/.Rhistory_me). I change the path in the
>> Preferences->Startup-> Initial working directory (~/xxx/yyy/) and then
>> the R history file in pref. to either /Users/myname/xxx/
>> yyy/.Rhistory_me or /Users/myname/xxx/yyy/me_Rhistory and hit return
>> before clicking anywhere else. Then I enter a few commands in R and
>> quit. I save workspace, it creates ~/xxx/yyy/.Rhistory (note it
>> ignores the file name I gave it) but it's always empty. If I go back
>> to preferences, the history file box shows ".Rhistory" regardless of
>> what name I told it to save it as.
>>
>> 4. d&d folder onto R.app icon, .Rhistory is written to that folder as
>> expected, but it remains empty no matter what.
>>
>> Tried deleting preference file multiple times, no help. I cannot
>> manage to get anything into the .Rhistory file from R.app. R from
>> terminal seems okay in this regard.
>>
>> So what is the way to make R.app actually save its history somewhere?
>> I don't want to use the history slide out button on the console and
>> have to save a file with each session, I'd like it to be automatic.
>> Thanks!
>> vi
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
More information about the R-SIG-Mac
mailing list