save an R session
save_jamsession( session = get("session", envir = envir), assign_session = TRUE, save_date = jamba::getDate(), do_timestamp = TRUE, sessions_path = jamsession_paths()$sessions, do_prompt = TRUE, do_window_title = TRUE, save_history = TRUE, envir = .GlobalEnv, session_prefix = "inProgress_", session_suffix = ".RData", verbose = TRUE, ... )
session |
|
---|---|
assign_session | logical whether to assign |
do_timestamp | logical whether to run |
sessions_path | character vector of one or more file paths to search
for saved R sessions. When |
do_prompt | logical whether to run |
do_window_title | logical whether to set the default device
window title to include the |
save_history | logical whether to save the R command history
into an |
envir | R environment to save, by default the active global
environment |
verbose | logical whether to print verbose output. |
... | additional arguments passed to |
date | the date string to use when naming the .RData file.
By default the current date is used, called by |
This function saves the current R session to a .RData
file,
and the R history to a .Rhistory
file. It saves these files
to the first write-accessible path in sessions_path
.
When envir
is defined as something other than globalenv()
,
only the R objects stored in that environment are saved.
However the R objects are saved as R objects, with no information
about the source environment.
By default this function will assign the value of session
to session
in the global environment, unless assign_session=FALSE
,
in order to reinforce the active R session name, and which
is shown by the R prompt by default, via calling jamba::setPrompt()
.
These changes are intended as visual reminders of the active R
session.
Other jamsession sessions:
grep_jamsessions()
,
list_jamsessions()
,
load_jamsession()
,
show_session_versions()