Re: [R] gsub() with unicode and escape character

2011-07-17 Thread Sverre Stausland
Sorry for not including those details. Here is a more detailed description: > data.frame(animals=c("dog","wolf","cat"))->my.data > gsub("o","\u0254",my.data$animals)->my.data$animals > my.data$animals [1] "dɔg" "wɔlf" "cat" > sessionInfo() R version 2.13.1 (2011-07-08) Platform: i386-pc-mingw3

Re: [R] gsub() with unicode and escape character

2011-07-17 Thread Uwe Ligges
t;\\numeric=<<12>>" "alpha=<>\\numeric=<<34>>" > cat(.Last.value, sep="\n") # see what is really in the strings alpha=<>\numeric=<<12>> alpha=<>\numeric=<<34>> I don't know about your unicode/encodi

Re: [R] gsub() with unicode and escape character

2011-07-17 Thread Nipesh Bajaj
;"   "alpha=<>\\numeric=<<34>>" >  > cat(.Last.value, sep="\n") # see what is really in the strings >  alpha=<>\numeric=<<12>> >  alpha=<>\numeric=<<34>> > > I don't know about your unicode/encodin

Re: [R] gsub() with unicode and escape character

2011-07-16 Thread Prof Brian Ripley
You forgot the 'at a minimum' information required by the posting guide. Most likely this is a limitation of the locale you used (and failed to tell us about) on the OS you used (...). On Sat, 16 Jul 2011, Sverre Stausland wrote: Dear helpers, I'm trying to replace a character with a unico

Re: [R] gsub() with unicode and escape character

2011-07-16 Thread Peter Langfelder
Don't know the answer to you first question, but for the \\ see below. On Sat, Jul 16, 2011 at 7:19 PM, Sverre Stausland wrote: > Unrelated to that problem, but related to gsub() is that I can't find > a way for gsub() to interpret the backslash as a character. In regular > expression, \\ should

Re: [R] gsub() with unicode and escape character

2011-07-16 Thread William Dunlap
what is really in the strings alpha=<>\numeric=<<12>> alpha=<>\numeric=<<34>> I don't know about your unicode/encoding problem. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-proj

[R] gsub() with unicode and escape character

2011-07-16 Thread Sverre Stausland
Dear helpers, I'm trying to replace a character with a unicode code inside a data frame using gsub(), but unsuccessfully. > data.frame(animals=c("dog","wolf","cat"))->my.data > gsub("o","\u0254",my.data$animals)->my.data$animals > my.data$animals [1] "dɔg" "wɔlf" "cat" It's not that a data fr