I'm sorry for my english :)
I need to detect if there is a special character in an address (variable "no_trans", 1 : if there is one or several special character, else 0) and in the next column ("carac_no_trans") I need to put the list of the special character, so if there is several special character I need to see all in this column.
My code (liste_carac is the list of non-special character. I need to detect all characters not included in this list) :
new <- data_adresse %>%
group_by(e_street_name) %>%
mutate(
no_trans = ifelse(
length(
setdiff(
unlist(strsplit(e_street_name,"")),
liste_carac
)
) >= 1,
1,
0
),
carac_no_trans = ifelse(
length(
as.list(
setdiff(
unlist(strsplit(e_street_name,"")),
liste_carac
)
)
) >= 1,
as.list(
setdiff(
unlist(strsplit(e_street_name,""))
liste_carac
),
),
"None"
)
)
But I see just the first special character and not all..
If you can help me :)
Have a good day ! Elise
paste
to combine all the special characters into one string.as.list
bypaste
but I have the same issue @BertilBaron ..