Skip to content

Can't save history using savehistory()

5 messages · Ken.Williams at thomsonreuters.com, Rob Goedman

#
savehistory() history doesn't seem to be doing anything on my platform.  Here's an example:

=======================================
[R.app GUI 1.35 (5665) i386-apple-darwin9.8.0]

[History restored from /Users/u0048513/.Rapp.history]
[1] "?Matrix"                             "15*275/1024"                         "log10(2^32/4)"
[4] "log2(10^6)"                          "library(ff)#"                        "ffload(\"ff/a\", rootpath=\"/tmp\")"
[1] 10
[1] "?Matrix"                             "15*275/1024"                         "log10(2^32/4)"
[4] "log2(10^6)"                          "library(ff)#"                        "ffload(\"ff/a\", rootpath=\"/tmp\")"
R version 2.12.1 (2010-12-16)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
size isdir mode               mtime               ctime               atime uid gid    uname   grname
~/.Rapp.history 17357 FALSE  644 2011-01-12 15:36:20 2011-01-12 15:36:20 2011-01-12 15:36:25 502 502 u0048513 u0048513
=======================================

As the last line shows, there shouldn't be a permissions problem.  One suspicious thing is that there are exactly 512 lines in the file ? but in the R.app preference pane I have the max number of history items set to 1000, so perhaps that's a red herring.

Any thoughts?

--
Ken Williams
Senior Research Scientist

Thomson Reuters

Phone: 651-848-7712
ken.williams at thomsonreuters.com
http://thomsonreuters.com
14 days later
#
Ken,

History is saved at the end of your session. 

During a session, the new commands should show up at the bottom of the history pane.

Regards,
Rob
On Jan 12, 2011, at 1:41 PM, ken.williams at thomsonreuters.com wrote:

            
#
Hi Rob,

I do see commands appended to the bottom of the history pane during my
session, but when I quit & re-launch they're gone again.

Perhaps they're being saved to a different location than they're being
read from?

--
Ken Williams
Senior Research Scientist
Thomson Reuters
Phone: 651-848-7712
ken.williams at thomsonreuters.com
http://labs.thomsonreuters.com
On 1/27/11 9:05 AM, "Rob Goedman" <robjgoedman at me.com> wrote:

            
#
Ken,

That is clearly not right.

Can you try saving the the history file from the history pane button and check what is written to the file?

Can you rename the history file and start over to see if that helps? If yes, would you mind sending me the renamed file?

Would you mind sending me your preference settings file? In: ~/Library/Preferences/org.R-project.R.plist .

Regards,
Rob
On Jan 27, 2011, at 7:38 AM, ken.williams at thomsonreuters.com wrote:

            
#
Hi Rob,

It appears that the file is being written to .Rhistory in the working
directory, but *I think* it reads from ~/.Rhistory in my home directory.
In my preference pane I've got it set to read from ~/.Rapp.history, so
that's 3 different files.  That last file seems to always be empty.

Here's my plist file (converted to text):  https://gist.github.com/798719

When you suggest renaming the file & starting over, which of those 3 would
you suggest?


--
Ken Williams
Senior Research Scientist
Thomson Reuters
Phone: 651-848-7712
ken.williams at thomsonreuters.com
http://labs.thomsonreuters.com
On 1/27/11 9:53 AM, "Rob Goedman" <robjgoedman at me.com> wrote: