Re: [R] how to replace a single forward slash with a double backward slash in a string?

2009-12-13 Thread David Winsemius
On Dec 13, 2009, at 1:58 PM, Peter Dalgaard wrote: David Winsemius wrote: On Dec 13, 2009, at 1:00 PM, Sean Zhang wrote: Dear R-helpers. Can someone kindly tell me how to replace a single forward slash with double backward slash in a string? i.e., from "a/b" to "a\\b" > sub("/", "

Re: [R] how to replace a single forward slash with a double backward slash in a string?

2009-12-13 Thread Peter Dalgaard
Peter Dalgaard wrote: David Winsemius wrote: On Dec 13, 2009, at 1:00 PM, Sean Zhang wrote: Dear R-helpers. Can someone kindly tell me how to replace a single forward slash with double backward slash in a string? i.e., from "a/b" to "a\\b" > sub("/", "","a/b") #the backslashes n

Re: [R] how to replace a single forward slash with a double backward slash in a string?

2009-12-13 Thread Peter Dalgaard
David Winsemius wrote: On Dec 13, 2009, at 1:00 PM, Sean Zhang wrote: Dear R-helpers. Can someone kindly tell me how to replace a single forward slash with double backward slash in a string? i.e., from "a/b" to "a\\b" > sub("/", "","a/b") #the backslashes need to be doubled becau

Re: [R] how to replace a single forward slash with a double backward slash in a string?

2009-12-13 Thread David Winsemius
On Dec 13, 2009, at 1:00 PM, Sean Zhang wrote: Dear R-helpers. Can someone kindly tell me how to replace a single forward slash with double backward slash in a string? i.e., from "a/b" to "a\\b" > sub("/", "","a/b") #the backslashes need to be doubled because they are the escape

[R] how to replace a single forward slash with a double backward slash in a string?

2009-12-13 Thread Sean Zhang
Dear R-helpers. Can someone kindly tell me how to replace a single forward slash with double backward slash in a string? i.e., from "a/b" to "a\\b" Many thanks in advance. -Sean [[alternative HTML version deleted]] __ R-help@r-project.org