Set data restrictions to one of the levels in the DUA crosswalk.

set_dua_level(level, deidentify_required = FALSE, id_column = NULL)

Arguments

level

String value of the data restriction level

deidentify_required

Set to TRUE if ID column must be changed to protect unique identifier.

id_column

Column with unique IDs that must be identified if deidentify_required == TRUE.

Examples

## -------------- ## Setup ## -------------- ## set DUA crosswalk dua_cw <- system.file('extdata', 'dua_cw.csv', package = 'duawranglr') set_dua_cw(dua_cw)
#> -- duawranglr note ------------------------------------------------------------- #> DUA crosswalk has been set!
## -------------- ## set restrictions at first level set_dua_level('level_i') ## ...same, but set unique ID column to be deidentified set_dua_level('level_i', deidentify_required = TRUE, id_column = 'sid')
#> -- duawranglr note ------------------------------------------------------------- #> Unique IDs in [ sid ] must be deidentified; use -deid_dua()-.