[R-SIG-Mac] [Rd] MacOSX R.app do not save history (PR#10850)

Rob Goedman goedman at mac.com
Wed Feb 27 22:25:49 CET 2008


Anuar,

I apologize for the previous html-email. I'm traveling in Europe and  
tried to reply using the web based interface to mac.com.

Basically I pointed to some previous message from mid-Jan 08, attached  
below.

More messages can be found using RSiteSearch('savehistory').

Hope this helps,
Rob


On Feb 26, 2008, at 10:00 PM, anuar at uchicago.edu wrote:

> Full_Name: Anuar Konkashbaev
> Version: 2.6.2
> OS: Mac OS X 10.4.11
> Submission from: (NULL) (128.135.32.210)
>
>
> R.app do not saves history while command line r does. When starting  
> R.app
> history from the command line session and all new commands from  
> current session
> are available, but when quiting R.app .Rhistory is overwritten but  
> only commands
> from command line session are saved in new file. Even if one will  
> save history
> explicitly with savehistory(".Rhistory") only commands from command  
> line session
> are saved in the .Rhistory file. .Rdata is saved correctly. History  
> works just
> fine in command line application.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


>
> On Jan 14, 2008, at 4:21 PM, Rob Goedman wrote:
>> Roger,
>>
>> The history features on Mac OS's R.app are handled by R.app
>> and is a (small) superset of R's facilties, e.g. it supports multi- 
>> line
>> history recalls.
>>
>> A disadvantage of this approach is that it's not possible to use
>> R's history() and savehistory() nor make usage completely
>> identical. The actual history files do 'interoperate', although
>> you will loose the multiline feature.
>>
>> A good list for Mac OS specific discussions is r-sig-mac at r-project.org 
>> .
>>
>> Hope this helps,
>> Rob
>>
>>
>> On Jan 13, 2008, at 6:47 PM, Day, Roger S. wrote:
>>
>>> Running Version 2.6.0  GUI 1.21.
>>> Generally, I enjoy working with the OSX GUI,
>>> which has some very pleasant features.
>>> Kudos to the developers!
>>>
>>> There is a nice history panel which slides out of the
>>> Console window.  The buttons on the panel work as expected.
>>> I am puzzled by the behavior of history() and savehistory()
>>> run from the Console window.  I would think that these functions
>>> would view and save the same set of commands as those seen in
>>> the history panel, but they don't.
>>> Can someone explain why, and how to fix it?


On Jan 14, 2008, at 4:34 PM, Peter Dalgaard wrote:
> Rob Goedman wrote:
>> Roger,
>>
>> The history features on Mac OS's R.app are handled by R.app
>> and is a (small) superset of R's facilties, e.g. it supports multi- 
>> line
>> history recalls.
>>
>> A disadvantage of this approach is that it's not possible to use
>> R's history() and savehistory() nor make usage completely
>> identical. The actual history files do 'interoperate', although
>> you will loose the multiline feature.
>>
>>
> That is actually the same in the readline-based terminal interface on
> Unix/Linux: If you terminate a line with C-v C-j, then it is recalled
> along with the subsequent line(s) by up-arrow. And history() et al.  
> also
> discard the grouping of lines there.
>
> -- 
>   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
>  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
> (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45)  
> 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45)  
> 35327907



On Jan 15, 2008, at 1:26 AM, Rob Goedman wrote:
> Roger,
>
> On Jan 14, 2008, at 1:14 PM, Day, Roger S. wrote:
>
>> Thanks, Rob,
>>
>> I'm still unsure on the key question.
>> Is there any way in R.app to save the commands run
>> in the Console into a *.history or .Rhistory file,
>> by running a command on the Console,
>> whether savehistory() or some other function call?
>
> Right now, there isn't in R.app.
>
>> (I'm trying to semi-automate a regular backup procedure while
>> in a very long interactive session at risk of hanging.)
>> Can you say more what you mean by "interoperate" here?
>
> The history file is updated on exiting R, which is clearly of no
> use to you. The updated history file can be read by both R
> and R.app, this is the interoperable part.
>
> If I recall correctly (it has been a few years!), to do what you
> need, would require a call back from R. I seem to remember
> this would not be hard to do but at that time was not
> available. Don't think it is today either.
>
> A possible approach is to run long interactive sessions from
> within the editor. Add a couple of statements and submit selection
> to R. If you're using the internal editor, save the file before
> submitting. From within an external editor, saving is less critical.
>
> Rob



More information about the R-SIG-Mac mailing list