This is not robust as it fails if all IDs are found not within map.

mapIdsToObfuscated(ids, map)

Arguments

ids

character vector with original IDs

map

named character vector where the values are the obfuscated IDs and the vector of names (names(map)) is the vector of original names.

Value

A dataframe or vector with original IDs replaced by their obfuscated counterparts.

Examples

# \donttest{ set_seed(1) ped <- qcStudbook(nprcgenekeepr::pedSix) obfuscated <- obfuscatePed(ped, map = TRUE) someIds <- c("s1", "s2", "d1", "d1") mapIdsToObfuscated(someIds, obfuscated$map)
#> [1] "JNAN5L" "0ZR5QI" "2D0P3X" "2D0P3X"
# }