[R] How to convert backslash to slash?

Duncan Murdoch murdoch at stats.uwo.ca
Tue Sep 23 23:49:32 CEST 2008


On 23/09/2008 4:00 PM, Shengqiao Li wrote:
> How to use sub, gsub, etc. to replace "\" in a string to "/"?
> 
> For example,convert "C:\foo\bar" to "C:/foo/bar".

If those are R strings, there are no backslashes in the first one.  It 
has a formfeed and a backspace in it.

Duncan Murdoch



More information about the R-help mailing list