Given the current project, soucoise_status() collects all information about cache (could be project level, file level)
and return a tibble with this data.
Arguments
- quiet
(boolean) (default
TRUE) no messages during execution- root
(string) (default
NULL) force root to a defined path, advanced and not recommanded use- prune
(boolean) (default
TRUE) clean up status to display only on relevant cache. However, does not clean other cache files.- clean
(boolean) (default
FALSE) check if some data files have not json referring to them and cleans if any.
Details
sourcoise_status() reflects what is on the disk (and results indeed from a scan of all cached files and their metadatas).
So modifying the result of sourcoise_status() can produce complex bugs when it is passed to sourcoise_refresh() or sourcoise_clean().
Data returned is:
src: path to the source file (r script)date: last execution datevalid: is cache valid ?uid: id of userindex: index of cachetiming: last execution timingsize: size of the R object(s) returnedlapse: periodic refresh triggerwd: wd setting for execution of r scriptargs: arguments passed to R scriptjson_file: path to the file keeping cache informationqmd_file: list of path to qmd files calling this script (relevant only for quarto projects)src_in: localisaiton of cache optiondata_file: path to data cacheddata_date: date and time of last save of datalog_file: path to log file, if logging activatedroot: path to the project root, used as reference for all pathsscr_hash: hash of the source filetrack_hash: hash of the tracked files, if anytrack: list of files trackedargs_hash: hash of argumentsdata_hash: hash of data cached
See also
Other sourcoise:
sourcoise(),
sourcoise_clear(),
sourcoise_refresh(),
sourcoise_reset()
Examples
dir <- tempdir()
set_sourcoise_root(dir)
#> [1] "/tmp/RtmpD1KJRa"
fs::file_copy(
fs::path_package("sourcoise", "some_data.R"),
dir,
overwrite = TRUE)
# Force execution
data <- sourcoise("some_data.R", force_exec = TRUE)
# status returns the cache status
sourcoise_status()
#> # A tibble: 1 × 23
#> src date valid priority uid index timing size lapse wd
#> <chr> <dttm> <lgl> <int> <chr> <dbl> <dbl> <chr> <chr> <chr>
#> 1 some_… 2025-11-24 11:02:15 TRUE 10 b27b… 1 0.0095 3 kB never file
#> # ℹ 13 more variables: args <list>, json_file <fs::path>, qmd_file <list>,
#> # src_in <chr>, data_file <chr>, data_date <chr>, file_size <chr>,
#> # log_file <chr>, root <chr>, src_hash <chr>, track_hash <list>,
#> # track <list>, data_hash <chr>
