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
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
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
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.
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
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
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
7 matches
Mail list logo