Search for saved R sessions

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,
  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.

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

Examples

grep_jamsessions(".");
#> session save_date days_old file_size #> dietrichmemfeb2021 dietrichmemfeb2021 23feb2021 3 151 Mb #> DMdata DMdata 11feb2021 15 625 Mb #> gokeyH1PD29may2019 gokeyH1PD29may2019 28jan2021 29 12 Mb #> bushel-mito-nuc-SNP bushel-mito-nuc-SNP 13jan2021 44 2.3 Mb #> ritux-workflow ritux-workflow 10aug2020 200 35 Mb #> proteinatlas proteinatlas 24jul2020 217 59 Mb #> slicejam-testing slicejam-testing 07jul2020 234 5.8 Mb #> LottyDah LottyDah 12jun2020 259 1.1 kb #> testOnly testOnly 03jun2020 268 12 Mb #> SARSinteractome SARSinteractome 27mar2020 336 12 Mb #> adam19-rnaseq adam19-rnaseq 09may2019 659 231 Mb #> session_path #> dietrichmemfeb2021 /Users/wardjm/Projects/R-sessions #> DMdata /Users/wardjm/Projects/R-sessions #> gokeyH1PD29may2019 /Users/wardjm/Projects/R-sessions #> bushel-mito-nuc-SNP /Users/wardjm/Projects/R-sessions #> ritux-workflow /Users/wardjm/Projects/R-sessions #> proteinatlas /Users/wardjm/Projects/R-sessions #> slicejam-testing /Users/wardjm/Projects/R-sessions #> LottyDah /Users/wardjm/Projects/R-sessions #> testOnly /Users/wardjm/Projects/R-sessions #> SARSinteractome /Users/wardjm/Projects/R-sessions #> adam19-rnaseq /Users/wardjm/Projects/R-sessions #> session_file #> dietrichmemfeb2021 inProgress_dietrichmemfeb2021_23feb2021.RData #> DMdata inProgress_DMdata_11feb2021.RData #> gokeyH1PD29may2019 inProgress_gokeyH1PD29may2019_28jan2021.RData #> bushel-mito-nuc-SNP inProgress_bushel-mito-nuc-SNP_13jan2021.RData #> ritux-workflow inProgress_ritux-workflow_10aug2020.RData #> proteinatlas inProgress_proteinatlas_24jul2020.RData #> slicejam-testing inProgress_slicejam-testing_07jul2020.RData #> LottyDah inProgress_LottyDah_12jun2020.RData #> testOnly inProgress_testOnly_03jun2020.RData #> SARSinteractome inProgress_SARSinteractome_27mar2020.RData #> adam19-rnaseq inProgress_adam19-rnaseq_09may2019.RData