When I read a determinate spanish web site I get spanish accents in HTML encoding. I read the website with readLines
function (I need use this function).
url <- "http://www.senamhi.gob.pe/include_mapas/_map_data_hist03.php?drEsta=01"
char_data <- readLines(url,encoding="UTF-8")
After making all operations to get my data I have a data frame where I have a variable with a character values that are words with accents. It would be something like:
var <- rep("Meteorológica",5)
I need to convert the spanish accents in HTML encoding to normal spanish accents. I tested with iconv
function
iconv(var, "UTF-8", "ASCII")
But It doesn't work, I get the same vector of characters of input. Also I tested changing encoding
option in readLines
function but neither works.
How can I do? Thanks.