Learn R Programming

keyed (version 0.2.0)

check_drift: Check for drift from committed snapshot

Description

Compares current data against its committed reference snapshot. When both snapshots are keyed with the same key columns, returns a cell-level diff. Otherwise falls back to structural comparison.

Usage

check_drift(.data, reference = NULL)

Value

A drift report (class keyed_drift_report), or NULL if no snapshot found.

Arguments

.data

A data frame with a snapshot reference.

reference

Optional content hash to compare against. If NULL, uses the attached snapshot reference.

Examples

Run this code
df <- key(data.frame(id = 1:3, x = c("a", "b", "c")), id)
df <- stamp(df)

# Modify the data
df$x[1] <- "modified"
check_drift(df)

Run the code above in your browser using DataLab