Message-ID: <20041125111725.37782.qmail@web25109.mail.ukl.yahoo.com>
Date: 2004-11-25T11:17:25Z
From: Manuel Gutierrez
Subject: substitute accents
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
______________________________________________