I´m trying to add a column to a data frame in R. To do this, I imported a CSV file from Excel, which contains the id column (the same as the one I have in the data frame), and the column with the information I want to add to my data frame.
My problem is that my cvs has spanish characters (´, ñ), and when I use read.csv (as in the following example)
religion <- read.csv("religion.csv", header = TRUE, sep = ",", dec = ".",
filled =TRUE, comment.char = "", strip.white = TRUE,
stringsAsFactors = TRUE)
the characters don't appear, but a question mark appears instead of the characters.
I have tried changing the encoding, with the following encodings:
UTF-8, latin1,
Sys.setlocale("LC_ALL", "ES_ES.UTF-8")
But there is no difference.
I gladly appreciate any help.