I am using dplyr package and the function recode while trying to recode a variable, because original authors have many typos. I have managed for instance to do "RKS (UNMIK)"="RKS" or "CU"="CUB" but the other examples from the code don't change. In some cases I even copy-pasted the original typo (i.e. "EGY. EU"), but it didn't work.
These values should be iso3 country codes, fyi.
What I also noticed in this case is that somehow looks like the "(" in "CHE" is matched by the ")" in "NOR". Does anyone know a better way to do it? Thank you in advance!
data<-data%>%
   mutate(parties=recode(parties,
                    " RKS (UNMIK)"="RKS",
                    "(CHE"="CHE",
                    "EGY. EU"="EGY,EU",
                    "BRA. PRY"="BRA-PRY",
                    "CU"="CUB",
                    "NOR)"="NOR",
                    "VNM)KOR"="VNM,KOR"))
 
     
    