powered by
Stores a hash-based snapshot of the current data state. Only one active reference per data frame (identified by its content hash).
commit_keyed(.data, name = NULL)
Invisibly returns .data with snapshot metadata attached.
.data
A data frame (preferably keyed).
Optional name for the snapshot. If NULL, derived from data.
The snapshot stores:
Row count
Column names and types
Hash of key columns (if keyed)
Hash of full content
Snapshots are stored in memory for the session. They are keyed by content hash, so identical data shares the same snapshot.
df <- key(data.frame(id = 1:3, x = c("a", "b", "c")), id) df <- commit_keyed(df) # Later, check for drift df2 <- df df2$x[1] <- "z" check_drift(df2)
Run the code above in your browser using DataLab