View source: R/sourcoise_meta.R
| sourcoise_meta | R Documentation |
Retrieves metadata about a cached script without fetching the actual data. This function provides quick access to information about script execution, cache status, and related files.
sourcoise_meta(path, args = NULL, root = NULL, quiet = FALSE)
path |
Path to the script file (character). Can be an absolute or relative path. |
args |
Named list of arguments that were passed to the script, if any. Default is |
root |
(defaut |
quiet |
(defaut |
A named list containing cache metadata with the following elements:
Cache status indicator: "cache ok&valid", "invalid cache", or "no cache data"
Execution time of the full script (duration)
Date and time of the last full execution
Size of objects returned, measured in R memory
Arguments given to sourcoise for the script
Delay interval before reexecution is triggered
List of files being tracked for changes
List of Quarto (.qmd) files calling this script
Path to the last log file
Size of cached data on disk
Date of last data save (note: if no new data is generated during execution, no new data file is saved)
Path to the cached data file (stored as .qs2 format)
Path to the JSON file storing metadata (located in .sourcoise directory)
dir <- tempdir()
set_sourcoise_root(dir)
fs::file_copy(
fs::path_package("sourcoise", "some_data.R"),
dir,
overwrite = TRUE)
# Force execution (root is set explicitly here, it is normally deduced from project)
data <- sourcoise("some_data.R", force_exec = TRUE)
# Access metadata without loading the cached data
meta <- sourcoise_meta("some_data.R")
print(meta$timing) # View execution time
print(meta$ok) # Check cache status
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.