Re: [R] regexpr with accents

2012-08-06 Thread arun
= 9 2  9 some tèxt = 9 3  9   some tèxt = 9 4  9   some tèxt = 9 A.K. - Original Message ----- From: Luca Meyer To: r-help@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 t

Re: [R] regexpr with accents

2012-08-06 Thread Luca Meyer
1 1 some text = 9 > 2 9 some tèxt = 9 > 3 9 some tèxt = 9 > 4 9 some tèxt = 9 > > A.K. > > > - Original Message - > From: Luca Meyer > To: r-help@r-project.org > Cc: > Sent: Monday, August 6, 2012 8:25 AM > Subject: [R] regexpr

[R] regexpr with accents

2012-08-06 Thread Luca Meyer
Sorry but my previous email did not go through properly. Instead of the ? you should really read an è or è 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èxt = 9",d1$V2)>0] <- 9 and d1$V1[regexpr("some

Re: [R] regexpr with accents

2012-08-06 Thread arun
uot;some text = 9",d1$V2)>0] <-9 d1 #  V1    V2 #1  9 some text = 9 #2  9   some téxt=9 #3  9   sóme tèxt=9 #4  9   söme text=9 #5  9   some têxt=9 A.K. ----- Original Message - From: Luca Meyer To: r-help@r-project.org Cc: Sent: Monday, August 6, 2012 1:55 AM Subject

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

[R] regexpr with accents

2012-08-05 Thread Luca Meyer
Hello, I have build a syntax to find out if a given substring is included in a larger string that works like this: d1$V1[regexpr("some text = 9",d1$V2)>0] <- 9 and this works all right till "some text" contains standard ASCII set. However, it does not work when accents are included as the foll