add_perturb {deident} | R Documentation |
De-identification via random noise
Description
add_perturb()
adds an perturbation step to a transformation pipeline
(NB: intended for numeric data). When ran as a transformation, each
specified variable is transformed by the noise
function.
Usage
add_perturb(object, ..., noise = adaptive_noise(0.1))
Arguments
object |
Either a |
... |
variables to be transformed. |
noise |
a single-argument function that applies randomness. |
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
See Also
adaptive_noise()
, white_noise()
, and lognorm_noise()
Examples
pipe.perturb <- add_perturb(ShiftsWorked, `Daily Pay`)
pipe.perturb$mutate(ShiftsWorked)
pipe.perturb.white_noise <- add_perturb(ShiftsWorked, `Daily Pay`, noise=white_noise(0.1))
pipe.perturb.white_noise$mutate(ShiftsWorked)
pipe.perturb.noisy_adaptive <- add_perturb(ShiftsWorked, `Daily Pay`, noise=adaptive_noise(1))
pipe.perturb.noisy_adaptive$mutate(ShiftsWorked)
[Package deident version 1.0.0 Index]