I have an openoffice spreadsheet with a column of character strings. Some of them contain accents. I want to read it in R so I have saved it as a csv file using Western Europe (ISO-8859-1) character set (the default, I've tried other sets but it doesn't help). R reads it fine with
CharMatrix<-read.csv("test.csv",header=F,sep=",",as.is=TRUE); Say I wan't to replace the 'o' with accent in the first cell. I've tried: gsub('ó','o', CharMatrix[1,1]) But, It doesn't make any substitution Trying to find a solution I input the character string in R and do the substitution: CharMatrix[1,1]<-"hóla" gsub('ó','o', CharMatrix[1,1]) And it works. I think the difference is that when I now print the content of CharMatrix I get a \201 before the ó while I didn't get it with the openoffice imported csv file. I'm sure it is a problem with my understanding of how accents can be specified. Can someone give me any solutions / references? Thanks, M _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 0.0 year 2004 month 10 day 04 language R ______________________________________________ Renovamos el Correo Yahoo!: ¡100 MB GRATIS! Nuevos servicios, más seguridad ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html