Skip to contents

Saves a snapshot dataset (typically produced by scan_storage()) as a uniquely identified .rds file.

Usage

save_scan(
  df,
  storage_id,
  path = here::here("data-raw", "snapshots"),
  label = NULL
)

Arguments

df

Data.frame. Scan result with a created_at attribute.

storage_id

Character. Identifier of the storage.

path

Character. Directory where the file will be saved.

label

Character. Optional human-readable label describing the scanned scope (e.g. "d_eviota").

Value

Invisibly returns the full file path of the saved .rds file.

Details

The filename encodes:

  • storage context

  • observation time

  • optional scope label

  • a deterministic hash

This ensures:

  • chronological ordering

  • uniqueness

  • reproducibility of stored observations

Examples

if (FALSE) { # \dontrun{
scan <- scan_storage("D:/_markdown")
save_scan(scan, "l480-ssd")
} # }