add_pseudonymize {deident} | R Documentation |
De-identification via replacement
Description
add_pseudonymize()
adds a psuedonymization step to a transformation pipeline.
When ran as a transformation, terms that have not been seen before are given a new
random alpha-numeric string while terms that have been previously transformed
reuse the same term.
Usage
add_pseudonymize(object, ..., lookup = list())
Arguments
object |
Either a |
... |
variables to be transformed. |
lookup |
a pre-existing name-value pair to define intended psuedonymizations. Instances of 'name' will be replaced with 'value' on transformation.#' |
Value
A 'DeidentList' representing the untrained transformation pipeline. The object contains fields:
-
deident_methods
a list of each step in the pipeline (consisting ofvariables
andmethod
)
and methods:
-
mutate
apply the pipeline to a new data set -
to_yaml
serialize the pipeline to a '.yml' file
Examples
# Basic usage;
pipe.pseudonymize <- add_pseudonymize(ShiftsWorked, Employee)
pipe.pseudonymize$mutate(ShiftsWorked)
pipe.pseudonymize2 <- add_pseudonymize(ShiftsWorked, Employee,
lookup=list("Kyle Wilson" = "Kyle"))
pipe.pseudonymize2$mutate(ShiftsWorked)