Using Phonetic from stringedist package - Removing same code for each line

Hello, I am pretty new to R and now I have the following problem:

I use the phonetic function from the stringdist package to remove the same names in a row with just spelling errors.
Example: See the first line

inventors = tibble::tribble(
                         ~Inv1,            ~Inv2,                  ~Inv3,          ~Inv4,        ~Inv5,
              "BRAINT ANTOINE", "BRIANT ANTOINE", "SAUR ERWIN FRIEDRICH",             NA,           NA,
              "DETLEF MUELLER", "DIRK MEYTHALER",         "GEYER HARALD", "HARALD GEYER", "SAUR ERWIN"
              )
head(inventors)
#> # A tibble: 2 x 5
#>   Inv1           Inv2           Inv3                 Inv4         Inv5      
#>   <chr>          <chr>          <chr>                <chr>        <chr>     
#> 1 BRAINT ANTOINE BRIANT ANTOINE SAUR ERWIN FRIEDRICH <NA>         <NA>      
#> 2 DETLEF MUELLER DIRK MEYTHALER GEYER HARALD         HARALD GEYER SAUR ERWIN

Created on 2021-05-29 by the reprex package (v2.0.0)

If I run the following code:

phonetic(inventors[1,])

I get something like
[1] "B653" "B653" "S665" NA NA

Now I want to go threw every row in my table and remove all the duplicates If there are any, but I only want to delete the duplicates for each row. If the same code appears in another row that's fine, just if its the same code multiple times in one table row.

I hope I could explain my problem and hope somebody can help me.

Thank you.

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.