savehistory {utils} | R Documentation |
Load or save or display the commands history.
loadhistory(file = ".Rhistory") savehistory(file = ".Rhistory") history(max.show = 25, reverse = FALSE)
file |
The name of the file in which to save the history, or from which to load it. The path is relative to the current working directory. |
max.show |
The maximum number of lines to show. Inf will
give all of the currently available history. |
reverse |
logical. If true, the lines are shown in reverse order. Note: this is not useful when there are continuation lines. |
This works under the readline
and GNOME interfaces, but not if
readline
is not available (for example, in batch use).
If you want to save the history (almost) every session, you can put a
call to savehistory()
in .Last
.
## Not run: .Last <- function() if(interactive()) try(savehistory("~/.Rhistory")) ## End(Not run)