Learn R Programming

keyed (version 0.2.0)

watch: Watch a keyed data frame for automatic drift detection

Description

Marks a keyed data frame as "watched". Watched data frames are automatically stamped before each dplyr verb, so check_drift() always reports changes from the most recent transformation step.

Usage

watch(.data)

Value

Invisibly returns .data with watched attribute set and a baseline snapshot committed.

Arguments

.data

A keyed data frame.

See Also

unwatch() to stop watching, stamp() for manual snapshots.

Examples

Run this code
df <- key(data.frame(id = 1:5, x = letters[1:5]), id) |> watch()
df2 <- df |> dplyr::filter(id > 2)
check_drift(df2)

Run the code above in your browser using DataLab