On 26 June 2005 at 20:30, Spencer Graves wrote:
|         How can one convert back slashes to forward slashes, e.g, changing 
| "c:\a\b" to "c:/a/b"?  I tried the following:
| 
|  > gsub("\\\\", "/", "c:\a\b")
| [1] "c:\a\b"

This does work, provided you remember that single backslashed "don't exist"
as e.g. \a is a character in itself. So use doubles are you should be fine:

> gsub("\\\\", "/", "c:\\a\\b")
[1] "c:/a/b"

Hth, Dirk

-- 
Statistics: The (futile) attempt to offer certainty about uncertainty.
         -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to