Skip to contents

Adds column names to the session-level safe list. Columns in this list are automatically excluded when ops_snapshot_cols is used to build a drop vector, in addition to the built-in protected columns ("eid", "sex", "age", "age_at_recruitment").

Usage

ops_set_safe_cols(cols = NULL, reset = FALSE)

Arguments

cols

(character) One or more column names to protect.

reset

(logical) If TRUE, clear the current user-registered safe list before adding. Default FALSE.

Value

Invisibly returns the updated safe cols vector.

Examples

ops_set_safe_cols(c("date_baseline", "townsend_index"))
#>  Safe cols registered: "date_baseline" and "townsend_index"
ops_set_safe_cols(reset = TRUE)  # clear user-registered safe cols
#>  User-registered safe cols cleared.