I am working with a dataframe in R that has some issues about encoding of strings. My dataframe df looks like this:
df
title
1 José Francisco Salgado - Executive Director and Founder
2 José Francisco Salgado - Executive Director and Founder
The issue is that strings should have accents where strange symbols are present. I tried next solution:
#Code
df$title <- iconv(df$title,"UTF-8","latin1")
But it is not working as I get same strings with weird symbols. I do not know why this is not working because when I try this it does the job:
#Code2
iconv("José Francisco Salgado - Executive Director and Founder","UTF-8","latin1")
[1] "José Francisco Salgado - Executive Director and Founder"
Setting accents for the strings. How can I solve this issue and have this:
df
title
1 José Francisco Salgado - Executive Director and Founder
2 José Francisco Salgado - Executive Director and Founder
Many thanks.
This is the dput() version of df:
#Data
df <- structure(list(title = c("José Francisco Salgado - Executive Director and Founder",
"José Francisco Salgado - Executive Director and Founder")), row.names = 1:2, class = "data.frame")
httrrequest which usedUTF-8encoding. I am using windows and after the request I usedrawToChar()to create an input that can be feed intofromJSON()function and extract the values you see. I do not know how to properly convert the data to get the accents that it has and also I do not know how to set in thehttrrequest and option to admit the accents.