loadhistory(file = ".Rhistory")
savehistory(file = ".Rhistory")history(max.show = 25, reverse = FALSE, pattern, ...)
timestamp(stamp = date(),
prefix = "##------ ", suffix = " ------##",
quiet = FALSE)
Inf
will
give all of the currently available history.grep
when doing
the matching.TRUE
, suppress printing timestamp to the console.#ifdef windows
The functions described here work in
The history mechanism is
#endif
#ifdef unix
The functions described here work on Unix-alikes under the
readline
command-line interface but may not otherwise (for
example, in batch use or in an embedded application). Note that Rcan be built without readline
.
The readline
history mechanism
#endif
is controlled by two environment variables: loadhistory
/savehistory
). There is no limit on the
number of lines of history retained during a session, so setting
These environment variables are read at the time of saving, so can be
altered within a session by the use of Sys.setenv
.
#ifdef unix
Note that readline
history library saves files with permission
0600
, that is with read/write permission for the user and not
even read permission for any other account.
#endif
The timestamp
function writes a timestamp (or other message)
into the history and echos it to the console. On platforms that do not
support a history mechanism only the console message is printed.
## Save the history in the home directory: note that it is not
## (by default) read from there but from the current directory
.Last <- function()
if(interactive()) try(savehistory("~/.Rhistory"))
Run the code above in your browser using DataLab