anonymize - In R - how do I replace all letters in a string with other letters? -
i need anonymize names in specific way format of entire string still same (spaces, hyphens, periods preserved) letters scrambled. want consistently replace a's c's, d's z's, , on. how that?
we can use chartr
chartr('ad', 'cz', str1) #[1] "cz,zc. c"
data
str1 <- c('ad,da. c')
Comments
Post a Comment