Re: [R] replacing backslashes with slashes using gsub

About this list Date view Thread view Subject view Author view Attachment view

From: Jeff Gentry (jgentry@jimmy.harvard.edu)
Date: Tue 25 May 2004 - 00:03:07 EST


Message-id: <Pine.SOL.4.20.0405241002480.3138-100000@santiam.dfci.harvard.edu>


> gsub("\\\\","/","D:\Prog\R\rw1090\library\cluster\libs")
> [1] "D:ProgR\rw1090libraryclusterlibs"

Probably not the best way, but what about escaping all the backslashes in
the original string?
 gsub("\\\\","/","D:\\Prog\\R\\rw1090\\library\\cluster\\libs")

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


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:12 EST