Replaces every detected identifier with a placeholder naming its type, for
example [PAN] or [PERSON_NAME]. Everything else in the text is kept
exactly. Redaction is irreversible; the rules are shared with the Python
package (see the spec's "Redaction" section).
Arguments
- text
A character vector.
- detectors
Detector ids to run;
NULLruns all registered detectors (seecg_detectors()).- context
Optional extra context per element of
text(recycled), treated as if it appeared next to every match.scan_pii()(planned) passes column names here, so a column calledvoter_idsupports Voter ID matches.- min_confidence
Drop matches scoring below this value.
See also
preview() to see what would be redacted and why.
Examples
redact("Name: Priya Nair; PAN: ABCPN1234K")
#> [1] "Name: [PERSON_NAME]; PAN: [PAN]"
redact(c("UPI priya.n@oksbi", "nothing here"))
#> [1] "UPI [UPI_ID]" "nothing here"