Am 20.05.2014 15:22, schrieb Jeff Newmiller:
Most importantly, "\\" is a string literal containing ONE backslash character. 
Yes you can create strings in R source code that represent Windows-style paths, but they 
must APPEAR different in that context. You may find it helpful to know that the print 
function can output escaped strings suitable for inclusion in R code, while the cat 
function can output those same strings without the escaping.

Thanks for your answer,

I am familiar with the escape strings, but I was looking for a way to convert copied path from windows:

working:

y=readline()
# paste f.e c:\foo1\foo2
y
[1] "c:\\foo1\\foo2"


but I was looking for

y=foo("c:\foo1\foo2").
because it is annoying to change all \ to \\ or to /

Regards Knut

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to