Re: [R] savehistory in OSX version

From: Rob Goedman <>
Date: Mon, 14 Jan 2008 16:26:48 -0800


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 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

> (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, 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.


> Roger
> -----Original Message-----
> From: Rob Goedman []
> Sent: Monday, January 14, 2008 10:21 AM
> To: Day, Roger S.
> Cc:
> Subject: Re: [R] savehistory in OSX version
> Roger,
> The history features on Mac OS's are handled by 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-
> 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?
>> Perhaps relevant: I generally have performed a setwd() , or
>> started R
>> by launching
>> a "Rdata" file.
>> Thanks.
>> Roger Day
>> University of Pittsburgh Departments of Biomedical Informatics and
>> Biostatistics University of Pittsburgh Cancer Institute University of
>> Pittsburgh Molecular Medicine Institute
>> **************************
>> Room 310, Suite 301
>> Cancer Pavilion (CNPAV)
>> 5150 Centre Ave.
>> Pittsburgh, PA 15232
>> e-mail:
>> cell phone 412-609-3918
>> assistant:
>> Lucy Cafeo: (412) 623-2952
>> ***************************
>> [[alternative HTML version deleted]]
>> ______________________________________________
>> mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 15 Jan 2008 - 00:31:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jan 2008 - 01:30:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive