Skip to content
Back to formatted view

Raw Message

Message-ID: <1344258077.36652.YahooMailNeo@web142603.mail.bf1.yahoo.com>
Date: 2012-08-06T13:01:17Z
From: arun
Subject: regexpr with accents
In-Reply-To: <17AFF53A-B4D5-4868-B294-594EA2B35EE2@gmail.com>

Hi,

Here, the string with in the quotes are read exactly like that.? So, you may have to use the symbol instead of "friendly" or "numeric" from the link.? Or you have to convert those.

d1 <- data.frame(V1 = 1:4,
??? V2 = c("some text = 9", "some t&egravext = 9", "some t?xt = 9", "some t&#232xt = 9"))

d1$V1[regexpr("some t&egravext = 9",d1$V2)>0] <- 9
?d1$V1[regexpr("some t&#232xt = 9",d1$V2)>0] <- 9
d1$V1[regexpr("some t?xt = 9",d1$V2)>0] <- 9

d1
? V1????????????????? V2
1? 1?????? some text = 9
2? 9 some t&egravext = 9
3? 9?????? some t?xt = 9
4? 9?? some t&#232xt = 9

A.K.


----- Original Message -----
From: Luca Meyer <lucam1968 at gmail.com>
To: r-help at r-project.org
Cc: 
Sent: Monday, August 6, 2012 8:25 AM
Subject: [R]  regexpr with accents

Sorry but my previous email did not go through properly. Instead of the ? you should really read an &egrave or &#232 according to http://www.lookuptables.com/.

So there are extended ASCII characters I need to deal with.

I have tried

d1$V1[regexpr("some t&egravext = 9",d1$V2)>0] <- 9
and 

d1$V1[regexpr("some t&#232xt = 9",d1$V2)>0] <- 9

without success...

Thanks,
Luca




??? [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.