deidentify_text: methods to deidentify different forms of data

Description Usage Arguments Value Examples

View source: R/deidentify_methods.R

Description

The deidentify_text method offers a flexible approach to encryption offering the user the option to encrypt text columns using either openssl or sodium. The encryption path chosen depends on the encryption key generated by the user. For example, if a user generates an aes_key, and passes it to deidentify_text, aes encryption will be automatically applied. The function will return a dataframe with the an encrypt_id suffix added to the end of the column name. Thus, a user will have to actively remove the unencrypted columns manually.

Usage

1
deidentify_text(.data, key, cols_to_encrypt = NULL)

Arguments

.data

a data frame

key

A cyphr key generated from the cyphr package

cols_to_encrypt

This is specific to data.frames. This should be a character vector specifying the names of the desired columns to encrypt.

Value

depending on the input, an object of the same class. If you input a data.frame, you will get a data.frame with columns with a enc suffix

Examples

1
2
3
4
5
6
## Not run: 
data("initiations")
aes_key <- gen_aes_key(24)
deidentify_text(initiations, "case_participant_id", aes_key)

## End(Not run)

phillydao/deidentify documentation built on Feb. 4, 2021, 2:31 p.m.