[R] Removing backslashes from data
markleeds at verizon.net
markleeds at verizon.net
Fri Apr 3 20:57:20 CEST 2009
Below works but it has two backslashes in the word. maybe someone can
explain why the 4 and 2 works but 2 1 doesn't ? thanks.
gsub("\\\\","","Hello\\World",perl=TRUE)
On Apr 3, 2009, Andrew Conway <agc282 at nyu.edu> wrote:
I am trying to check for backslashes in data, then remove them when I
find them, but am having a difficult time figuring out the best way to
do it. I know the backslash is the escape character in R, and I
should be able to use 'gsub' to accomplish this, but I all I seem to
be getting are errors. For example:
If entry is:
"Hello\World"
I want:
"HelloWorld"
There are several entries with backslashes, and I need to find them
and delete them. All help is welcome, thank you.
___________________________________
Drew Conway
Ph.D. Student
Department of Politics, New York University
[1]agc282 at nyu.edu
[2]http://homepages.nyu.edu/~agc282
[[alternative HTML version deleted]]
______________________________________________
[3]R-help at r-project.org mailing list
[4]https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
[5]http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
References
1. mailto:agc282 at nyu.edu
2. http://homepages.nyu.edu/~agc282
3. mailto:R-help at r-project.org
4. https://stat.ethz.ch/mailman/listinfo/r-help
5. http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list