Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Not all sensitive data is recorded as strings - features such as age, date of birth, or income could result in aspects of a data set being personally identifiable. To aid with these challenges we include methods for 'perturbing' numeric data (the addition of random noise).
Three types of random noise are included:
adaptive_noise
[default] - random noise which scales with the standard deviation of the variable transformed.white_noise
- random noise at a set spread.lognorm_noise
- random multiplicative noise at a set spread.NB: we set a random seed using set.seed
here for reproducibility. We recommend users avoid this step when using the package in production code.
library(deident) set.seed(101) perturb_pipe <- ShiftsWorked |> add_perturb(`Daily Pay`) apply_deident(ShiftsWorked, perturb_pipe)
To change the noise, pass one of the functions including the desired level of noise.
perturb_pipe_white_noise <- ShiftsWorked |> add_perturb(`Daily Pay`, noise = white_noise(sd=0.3)) apply_deident(ShiftsWorked, perturb_pipe_white_noise)
perturb_pipe_heavy_adaptive_noise <- ShiftsWorked |> add_perturb(`Daily Pay`, noise = adaptive_noise(sd.ratio=0.4)) apply_deident(ShiftsWorked, perturb_pipe_heavy_adaptive_noise)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.