anonymize_tbl: Generating a new 'anonymized' version of a dataframe

View source: R/anonymization.R

anonymize_tblR Documentation

Generating a new 'anonymized' version of a dataframe

Description

The data frame will be anonymized by doing 3 things:

  1. Replicating about perc_dev of the rows randomly.

  2. Getting a random subset from those of about 1 - perc_dev

  3. Randomizing numeric values by multiplying them by random values between 1 - perc_dev and 1 + perc_dev

  4. Randomizing non-numeric values by reassigning the randomly to new rows.

Usage

anonymize_tbl(tbl_in, vec_col_names, perc_dev = 0.2)

Arguments

tbl_in

The data frame containing the data to be anonymized

vec_col_names

vector of column names that need to be anonymized

lat

The name of the column containing the latitude data

Examples

tbl_companies_uk_anon <- anonymize_tbl(tbl_companies_uk, vec_col_names = c("LONGITUDE_RA", "LATITUDE_RA", "ESTABLISHMENT_DATE"))

mark-me/graydon.package documentation built on Nov. 14, 2023, 5:31 p.m.