View source: R/subset_snapshot.R
| subset_snapshot | R Documentation |
Selects observations from a snapshot according to structural criteria such as paths, extensions, or exclusion patterns.
subset_snapshot(
snapshot_path,
folder_path,
extensions = NULL,
exclude_patterns = c("\\.Rcheck")
)
snapshot_path |
Character. Path to |
folder_path |
Character vector. One or more folder roots. |
extensions |
Optional character vector of file extensions (no dot). |
exclude_patterns |
Optional regex patterns to exclude paths. |
The function performs observational selection only and does not derive Record Sets, contextual hierarchies, or analytical groupings.
The function returns a subset of the original snapshot while preserving
its observational provenance (e.g. created_by, created_at).
In addition, it derives a rel_root_path column, which represents the
path of each file relative to the matched filter root. When multiple
folder_path values are provided, the deepest matching root is used.
The rel_root_path is a context-dependent projection intended for
grouping, navigation, and reporting. It is not a stable identifier and
should not be used for joins or identity; use rel_path for that purpose.
data.frame filtered snapshot with rel_root_path
data("fscontextdemo_snapshot_02")
tmp <- tempfile(fileext = ".rds")
saveRDS(fscontextdemo_snapshot_02, tmp)
subset_snapshot(
snapshot_path = tmp,
folder_path = "D:/_packages/fscontextdemo/R"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.