[R] Replacing backslashes with slashes

Seth Falcon sfalcon at fhcrc.org
Wed Jan 4 19:32:50 CET 2006

Hi Yvonnick,

On  4 Jan 2006, yvonnick.noel at uhb.fr wrote:
> I am writing a GUI for R with the Rpad library. I have a "browse"
> button for data loading and Windows return a path string with
> backslashes. I need to convert them into slashes to use the string
> with read.table.

Can you provide some further detail on how the string is created?  I'm
not familiar with Rpad, but I wonder if the issue isn't at that level.

Note that if you create a string with single '\', R eats them up and
at that point there is nothing you can do:

s <- "x\y\z"
[1] "xyz"

Do you have a way of printing your path string?  

+ seth

More information about the R-help mailing list