Anonymize information in the dataframe.
anonymize(df, cols_to_anon = "name", algo = "crc32")
df | The dataframe you wish to anonymize |
---|---|
cols_to_anon | The columns to anonymize. The default is people's names. |
algo | The algorithms to be used. The available choices are md5, which is also the default, sha1, crc32, sha256, sha512, xxhash32, xxhash64, and murmur32. |
Returns a dataframe with an anonymized column named 'id'.
DF <- data.frame(name = c("John", "Jon", "Jonathan", "Jon"), year = c(2010,2010,2011,2011), pay = c(5000,7000,8000,7000)) anonymize(DF)#> name year pay id #> 1 John 2010 5000 a8b13f77 #> 2 Jon 2010 7000 caf56f5d #> 3 Jonathan 2011 8000 10d899e9 #> 4 Jon 2011 7000 caf56f5ddf <- anonymize(df=sals18, cols_to_anon = "place_of_residence")