[R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread ottorino
Deae R helpers, the problem I'm facing today is related to the manipulation of a string. The string is coming from a a porosimeter, whose control is under a complicate set-up of two computers One (running on DOS) is controlling directly the hardware, while the other (running on win XP) which

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread David Winsemius
On Apr 10, 2012, at 9:44 AM, ottorino wrote: Deae R helpers, the problem I'm facing today is related to the manipulation of a string. The string is coming from a a porosimeter, whose control is under a complicate set-up of two computers One (running on DOS) is controlling directly the

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread ottorino
Il giorno mar, 10/04/2012 alle 09.54 -0400, David Winsemius ha scritto: Perhaps, modulo encoding issues I'm not expert in, one more backslash than you tried: gsub( \\\xb2 , 2, (MPa)\t(mm3)\t(nM)\t(mm3/g)\t(mm3/g)\t(%)\t(m \xb2/g)\t) [1]

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread Rui Barradas
Hello, To use the octal code works with me. # I've created a file with that byte only. x - readLines(ascii0178) y - c(as.character(1:4), x, as.character(6:10)) y grep(\262, y) # should return 5 gsub(\262, HERE, y) Hope this helps, Rui Barradas -- View this message in context:

Re: [R] substitution of the ASCII character squared AKA ^2 AKA (alt+0178) with a tractable one

2012-04-10 Thread Rui Barradas
P.S. : \xb2 works but must be used with perl = TRUE. # 'y' defined as above. grep(\xb2, y, perl = TRUE) gsub(\xb2, HERE, y, perl = TRUE) Rui Barradas -- View this message in context: