list_jamsessions: List saved R sessions

list_jamsessionsR Documentation

List saved R sessions

Description

List saved R sessions

Usage

list_jamsessions(
  sessions_path = jamsession_paths()$sessions,
  most_recent = FALSE,
  session_prefix = "^inProgress_",
  session_suffix = "[.]RData$",
  add_stats = FALSE,
  ...
)

Arguments

sessions_path

character vector of one or more file paths to search for saved R sessions. When NULL, it uses the output from jamsession_paths()$sessions.

most_recent

logical whether to return only the most recent saved entry for each session name. When most_recent is FALSE, this function returns all saved versions for all R session names.

session_prefix, session_suffix

character string used as prefix or suffix when searching each path in sessions_path for matching file names.

add_stats

logical indicating whether to include summary stats for each session: number_saved is the number of past versions of the session; total_size is the total file size for all saved versions.

...

additional parameters are ignored

Details

This function lists available saved R sessions, usually called by grep_jamsessions().

When most_recent=TRUE it returns only the most recent session based upon the save_date.

It is possible to supply multiple file paths using the argument sessions_path, in which case all sessions are returned for all directories, then they are sorted by save_date. The input sessions_path is stored as an ordered factor, such that two sessions with the same save_date will still be ordered consistent with the input directories in sessions_path. In this case, when most_recent=TRUE there will be one entry returned per object name, and the first entry will be the most recent entry ordered by save_date then sessions_path. In practice, it is recommended to use one sessions_path location, but this option exists.

For example, jamsession(grep_sessions("my_session")) will load the most recent session by save_date where any ties prefer the order in sessions_path. Similarly, load_jamsession("my_session") does the same thing, without the grep_patten search step.

Value

list containing

session_df

data.frame of R session information

session

vector of matching R session names

See Also

Other jamsession sessions: grep_jamsessions(), load_jamsession(), save_jamsession(), show_session_versions()

Examples

list_jamsessions();


jmw86069/jamsession documentation built on June 8, 2022, 8:47 p.m.