[R] Replacing backslashes with slashes
yvonnick.noel at uhb.fr
Wed Jan 4 20:11:04 CET 2006
> For example, if I make a file names.txt with contents
> c:\My Documents\data.dat
> (even without quotes) then
> > A
>  "c:\\My Documents\\data.dat"
> so the result is now in the format such that gsub will work.
>  "c:/My Documents/data.dat"
Yes. I agree that this work. But I am sure you'll agree that it is not
way to get double backslashes ! But it looks like it is the only way to get it
in R. Jim Holtman also suggested a similar solution with scan().
before the string is passed to R.
> So now all that would remain is for you to work out how best
> to get the filename from the web page into the file which is
> read by 'readLines'. One would need more information to work
> out how to do that in the context of your usage.
This would not be a problem. I could use R functions to do this, since Rpad
allows you to mix R code with standard web scripting.
More information about the R-help