Re: [R] replace double backslash with singel backslash

2011-11-09 Thread Kay Cecil Cichini
Thanks, that helped! Yours, Kay Zitat von Gene Leynes : I think that people are afraid to say "You can't do that in R"... But I think the real answer is: you can't do that in R. Although, it is helpful to understand Jeff's reply. I hadn't fully realized why this particular problem occurs bef

Re: [R] replace double backslash with singel backslash

2011-11-04 Thread Jeff Newmiller
A) you wrote // when you meant \\. This behavior does not apply to forward slash. B) if you want the ability to represent any arbitrary character in a string, some version of this feature is required. Visual Basic doesn't allow arbitrary characters unless you concatenate chr() function calls, t

Re: [R] replace double backslash with singel backslash

2011-11-04 Thread Gene Leynes
I think that people are afraid to say "You can't do that in R"... But I think the real answer is: you can't do that in R. Although, it is helpful to understand Jeff's reply. I hadn't fully realized why this particular problem occurs before reading that. It's odd to me that // and / are both stor

Re: [R] replace double backslash with singel backslash

2011-11-04 Thread Jeff Newmiller
Your str does not have any double backslashes to replace. You need to revisit the concept of escape characters in the documentation. In brief, every "\\" in a quoted string is actually a single character as stored in memory.

Re: [R] replace double backslash with singel backslash

2011-11-04 Thread Michael Friendly
On 11/4/2011 5:35 AM, Kay Cichini wrote: I want to replace \\ with \ in: str<- "C:\\DOKUME~1\\u0327336\\LOKALE~1\\Temp\\RtmpQ5NJ8X\\TIRIS_PICS\\1_Img.jpg" and tried: gsub("", "\\", str) but this removes the \\ without replacing them by \ You may be able to avoid this simply by using forw

Re: [R] replace double backslash with singel backslash

2011-11-04 Thread Jim Holtman
what is the problem that you are trying to solve? you need the double \\ since they have a special meaning in quoted strings. in this case they represent a since backslash. if you really had a single one, then something like this '\n' would be a carriage return. Sent from my iPad On Nov 4

[R] replace double backslash with singel backslash

2011-11-04 Thread Kay Cichini
I want to replace \\ with \ in: str <- "C:\\DOKUME~1\\u0327336\\LOKALE~1\\Temp\\RtmpQ5NJ8X\\TIRIS_PICS\\1_Img.jpg" and tried: gsub("", "\\", str) but this removes the \\ without replacing them by \ Any help much appreciated, Kay - Kay Cichini Postgraduate studen