Re: [R] regexpr with accents

2012-08-06 Thread arun
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èxt = 9", "some tèxt = 9", "some tèxt = 9"))

Re: [R] regexpr with accents

2012-08-06 Thread Luca Meyer
Thanks Arun, It works all right, I just found out that my problem was not with accents but with the correct spelling of "some text". Kind regards, Luca Il giorno 06/ago/2012, alle ore 15.01, arun ha scritto: > > > Hi, > > Here, the string with in the quotes are read exactly like that.

Re: [R] regexpr with accents

2012-08-06 Thread arun
HI, It works with me.  I am using R 2.15 on Ubuntu 12.04.  d1 <- data.frame(V1 = 1:5, V2=c("some text = 9", "some téxt=9","sóme tèxt=9",  "söme text=9", "some têxt=9")) d1 #  V1    V2 #1  1 some text = 9 #2  2   some téxt=9 #3  3   sóme tèxt=9 #4  4   söme text=9 #5  5   some têxt=9   d

Re: [R] regexpr with accents

2012-08-05 Thread Rui Barradas
Hello, Works with me: d1 <- data.frame(V1 = 1:3, V2 = c("some text = 9", "some tèxt = 9", "some other text = 9")) regexpr("some text = 9", d1$V2) [1] 1 -1 -1 attr(,"match.length") [1] 13 -1 -1 regexpr("some tèxt = 9", d1$V2) [1] -1 1 -1 attr(,"match.length") [1] -1 13 -1 d1$V1[regexpr("so