A key list says which real names (people, places, organisations ...) are replaced by which placeholder. It can be
a CSV, TSV or Excel file with two columns: original, replacement (a header line is fine),
text lines like
"Anna Schmidt = [Person A]",a named character vector
c("Anna Schmidt" = "[Person A]").
Value
A named character vector (names = originals) with the matching
options as attributes; pass it to qda_import(pseudonyms = ...).
Examples
key <- qda_pseudonyms(c("Anna Schmidt = [Person A]", "Hamburg = [City 1]", "Anna = [Person A]"))
key
#> Anna Schmidt Hamburg Anna
#> "[Person A]" "[City 1]" "[Person A]"
#> attr(,"jq_pseudonyms")
#> [1] TRUE
#> attr(,"whole_word")
#> [1] TRUE
#> attr(,"ignore_case")
#> [1] FALSE
f <- file.path(tempdir(), "key.csv")
writeLines(c("original,replacement", "Anna Schmidt,[Person A]"), f)
qda_pseudonyms(f)
#> Anna Schmidt
#> "[Person A]"
#> attr(,"jq_pseudonyms")
#> [1] TRUE
#> attr(,"whole_word")
#> [1] TRUE
#> attr(,"ignore_case")
#> [1] FALSE