Computes a DataFingerprint: a content hash of x plus the structural facts
(dimensions, column names) that make a mismatch between two runs diagnosable.
Used to record which data a run actually used, so undocumented drift between
experiments is visible.
Arguments
- x
tabular data: The dataset. Required for every method, so that dimensions and column names are always recorded, even when hashing file bytes.
- method
Character {"file", "object", "table"}: What to hash. "object" hashes the serialized R object (cheap, R-only). "file" hashes the raw bytes of
source. "table" hashes the canonical Arrow IPC representation (cross-language; requires thearrowpackage).- algorithm
Character: Hash algorithm passed to digest::digest. See
DATA_HASH_ALGORITHMS.- source
Optional Character: Path
xwas read from. Required whenmethodis "file".
Examples
fp <- data_fingerprint(iris)
fp
#> <DataFingerprint>
#> hash: 2191b3e4d777… (sha256, object)
#> dim: 150 x 5
#> source: NULL
#> portability: single_language
# A logically identical table with a different R representation hashes
# differently under "object", which is why it is "single_language":
data_fingerprint(iris)@hash == data_fingerprint(as.data.frame(iris))@hash
#> [1] TRUE