Adds a stable UUID column to each row. This is an opt-in feature for
tracking row lineage through transformations.
Usage
add_id(.data, .id = ".id", .overwrite = FALSE)
Value
Data frame with ID column added.
Arguments
.data
A data frame.
.id
Column name for the ID (default: ".id").
.overwrite
If TRUE, overwrite existing ID column. If FALSE (default),
error if column exists.
Details
IDs are generated using a hash of row content plus a random salt,
making them stable for identical rows within a session but unique across
different data frames.
If the uuid package is available, it will be used for true UUIDs.
Otherwise, a hash-based ID is generated.