Skip to content
Prev 32048 / 398506 Next

savehistory not working properly in R?

On Wed, 14 May 2003, Paul Y. Peng wrote:

            
Yes.  The history is associated with the command-line editing: what you 
are doing is considered to be BATCH use.
The real problem is in your .Last.  You could do

.Last <- function ()
{
    if(interactive()) savehistory(file = ".Rhistory")
}

or use try():  if you are worried about not saving .RData you really 
should protect the commands in .Last (see its help page for warnings).

I'll see if the documentation can be clarified.