[R-SIG-Mac] getting history() to work

David Winsemius dwinsemius at comcast.net
Mon Apr 12 10:36:15 CEST 2010


On Apr 8, 2010, at 11:45 AM, David wrote:

>
>
> On 8 Apr, 13:32, David Winsemius <dwinsem... at comcast.net> wrote:
>> On Apr 8, 2010, at 4:56 AM, David wrote:
>>
>>> When I type history() to the R console, I get a new window that is
>>> always blank. How can I get history() working?
>
> ...[snip]...
>
>> It's been a whiles since I used R 2.8 but perhaps the current  
>> behavior
>> is similar. What happens when you:
>>
>> A) Open the Preferences dialog in the RGUI and look at your history
>> settings (which in the current GUI are in the Startup panel.)
> Looks normal to me. Setting relating to history seem OK. Should I send
> you personally a screen shot? I don't think I can attach an image for
> the whole forum. In Preferences, the history file was listed as
> .Rhistory. I tried to change this to ~/.Rhistory, but when I closed R
> and reopened it, it reverted to .Rhistory.

(I use the GUI, so this may or may not parallel your experience.) When  
I execute history() from the GUI console, a file opens up with about  
20 commands that I have not used recently. When I choose "Save as" it  
offers the name "hist496ef7b9" and the location is a temp directory  
fairly deep in the /private/var/... directories. It looks like I was  
wrong about thinking that such files would always be given  
an .Rhistory name. I get the recent historical entries in the GUI by  
clicking the Show/Hide History icon. I suspect that the history()  
function is more useful in the command line initiated sessions of R  
but not normally used in the GUI sessions.

-- 
David.

>
>> B) Open a Terminal.app window and type in:
>>   locate .Rhistory
> I got a large number of hits. I recognized all the directories as
> directories which had been, at one time or another, possibly with a
> different version of R, the working directory for some R program. I
> deleted all these hits as confusing the issue. I found one .Rhistory
> in the working directory, containing a single command that I almost
> certainly gave some time today. At some point today I deleted this
> file and it has been re-created with this single command in it.
> Nevertheless, history() continues to give me a blank screen. If things
> were operating as I wish, there would have been many commands
> in .Rhistory, since I have typed many commands to the R console today.
> ...[snip]...
>
> David
>
> _______________________________________________
> 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