grep_jamsessions: Search for saved R sessions

grep_jamsessionsR Documentation

Search for saved R sessions

Description

Search for saved R sessions

Usage

grep_jamsessions(
  pattern,
  sessions_path = jamsession_paths()$sessions,
  return_df = TRUE,
  sort_by_date = TRUE,
  ignore.case = TRUE,
  most_recent = TRUE,
  include_attrs = FALSE,
  add_stats = FALSE,
  remove_pattern = NULL,
  replacement = NULL,
  verbose = FALSE,
  ...
)

Arguments

pattern

chracter pattern used with grep() to match session names.

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.

return_df

logical whether to return a vector (FALSE) or data.frame (TRUE) with detailed information about each session.

sort_by_date

logical whether to sort results by date, as opposed to the order retrieved from list.files.

ignore.case

logical sent to grep, by default TRUE which searches in case-insensitive mode.

most_recent

logical whether to return only the most recent saved version of each matching session, by default TRUE. This argument is passed to list_jamsessions().

include_attrs

logical indicating whether to include attributes "file_path", "file_size", "save_date", and "days_old", only used when return_df=FALSE.

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.

remove_pattern, replacement

arguments passed to clean_jamsession_name().

verbose

logical indicating whether to print verbose output.

...

additional arguments are passed to list_jamessions(), and jamba::provigrep(), as relevent. If session_prefix or session_suffix should be customized, it should be done here.

Details

This function searches for saved R sessions using one or more text or regular expression patterns.

See list_jamsessions() for more details about stored sessions.

This function can be chained with load_jamsession(), for example load_jamsession(grep_jamsessions("my_project")), and it will load the most recently saved R session.

See Also

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

Examples

grep_jamsessions(".");


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