Hello,
i have the following test-code for you:
####TESTING HERE
test = tibble::tribble(
~Name1, ~Name2, ~Name3,
"Paul Walker", "Paule Walkr", "Heiko Knaup",
"Ferdinand Bass", "Ferdinand Base", "Michael Herre"
)
library(stringdist)
output <- list()
for (row in 1:nrow(test))
{
codephon = phonetic(test[row,], method = c("soundex"), useBytes = FALSE)
output[[row]] <- codephon
}
#building the matrix with soundex input
phoneticmatrix = matrix(output)
soundexspalten=str_split_fixed(phoneticmatrix, ",", 3)
#> Error in str_split_fixed(phoneticmatrix, ",", 3): konnte Funktion "str_split_fixed" nicht finden
soundexmatrix0 = gsub('[()c"]', '', soundexspalten)
#> Error in gsub("[()c\"]", "", soundexspalten): Objekt 'soundexspalten' nicht gefunden
soundexmatrix1 = gsub("0000", "", soundexmatrix0)
#> Error in gsub("0000", "", soundexmatrix0): Objekt 'soundexmatrix0' nicht gefunden
Created on 2021-06-03 by the reprex package (v2.0.0)
now I want to !!!replace all duplicates in soundexmatrix1 with the string "DUPLICATE" so the dimension of the Matrix stays the same and all duplicates can be seen straight away.
Any ideas how to do that?
Thanks for your help!