
Redact sensitive information from a vector of strings
redact_all.Rd
This function redacts sensitive information, such as email addresses, phone numbers, IP addresses, and domains, from a vector of strings. It uses the `redact_*` family of functions to perform the redaction.
Usage
redact_all(
text,
redact_funcs = default_redact_functions(),
replace_with = NULL
)
Arguments
- text
A character vector of text to be redacted.
- redact_funcs
A list of redaction functions to be applied to the text. Each function should take a character vector as input and return a character vector with the sensitive information redacted. Default is set to all of the currently defined `redact_*` functions.
- replace_with
A string to replace the sensitive information with. The default is "[REDACTED]".
Examples
text <- c("My phone number is 555-555-1234", "My email is john@example.com")
redact_all(text)
#> [1] "My phone number is [REDACTED]" "My email is [REDACTED]"
redact_all(text, redact_funcs = list(redacted::redact_phone_numbers, redacted::redact_ip_addresses))
#> [1] "My phone number is [REDACTED]" "My email is john@example.com"