deident.Rd
deident()
creates a transformation pipeline of 'deidentifiers' for
the repeated application of anonymization transformations.
deident(data, deidentifier, ...)
A data frame, existing pipeline, or a 'deidentifier' (as either initialized object, class generator, or character string)
A deidentifier' (as either initialized object, class generator, or character string) to be appended to the current pipeline
Positional arguments are variables of 'data' to be transformed and key-word arguments are passed to 'deidentifier' at creation
A 'DeidentList' representing the untrained transformation pipeline. The object contains fields:
deident_methods
a list of each step in the pipeline (consisting of variables
and method
)
and methods:
mutate
apply the pipeline to a new data set
to_yaml
serialize the pipeline to a '.yml' file
#
pipe <- deident(ShiftsWorked, Pseudonymizer, Employee)
print(pipe)
#> DeidentList
#> 1 step(s) implemented
#> Step 1 : 'Pseudonymizer' on variable(s) Employee
#> For data:
#> columns: Record ID, Employee, Date, Shift, Shift Start, Shift End, Daily Pay
apply_deident(ShiftsWorked, pipe)
#> # A tibble: 3,100 × 7
#> `Record ID` Employee Date Shift `Shift Start` `Shift End` `Daily Pay`
#> <int> <chr> <date> <chr> <chr> <chr> <dbl>
#> 1 1 OWRHa 2015-01-01 Night 17:01 00:01 78.1
#> 2 2 XeROL 2015-01-01 Day 08:01 16:01 155.
#> 3 3 5Neg2 2015-01-01 Day 08:01 16:01 77.8
#> 4 4 mEALu 2015-01-01 Day 08:01 15:01 203.
#> 5 5 00660 2015-01-01 Night 16:01 23:01 211.
#> 6 6 flPmk 2015-01-01 Night 17:01 00:01 142.
#> 7 7 JdNHb 2015-01-01 Rest NA NA 0
#> 8 8 5n3RG 2015-01-01 Night 17:01 00:01 213.
#> 9 9 lND1s 2015-01-01 Night 16:01 00:01 219.
#> 10 10 MNluG 2015-01-01 Night 16:01 00:01 242.
#> # ℹ 3,090 more rows