[R] Is 'history' recorded in Rscript?

Peng Yu pengyu.ut at gmail.com
Sat Sep 5 16:52:24 CEST 2009


Hi,

I got the following error. Does it mean that the files in the save
session will not be saved in history in Rscript?

$ Rscript savehistory.R
> f=tempfile()
> f
[1] "/tmp/RtmpMEGKVq/file327b23c6"
> savehistory(f)
Error in savehistory(file) : no history available to save
Execution halted

Regards,
Peng

On Sat, Sep 5, 2009 at 1:04 AM, David Winsemius<dwinsemius at comcast.net> wrote:
> You should be looking for .Rhistory
>
> Some OSes make that task difficult. "savehistory" is not the file name but
> rather the name of the function that performs that operation. Try
> savehistory(file="text.Rhistory") and see if the history file is easier to
> find. Should be in your working directory.
>
> Rscript is a program, not a record of the prior session.
>
>
> --
>  David.
>
> On Sep 4, 2009, at 11:03 PM, Peng Yu wrote:
>
>> Hi,
>>
>> I run the following command and try to save the commands that have
>> been run in the script. But it seems that no history is recorded. Is
>> it because that the history is not recorded in Rscript?
>>
>> Regards,
>> Peng
>>
>> $ Rscript savehistory.R
>>>
>>> f=tempfile()
>>> f
>>
>> [1] "/tmp/Rtmp7WBjGG/file327b23c6"
>>>
>>> history()
>>
>> Error in savehistory(file) : no history available to save
>> Calls: history -> savehistory
>> Execution halted
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
>
>




More information about the R-help mailing list