Escape characters cause a lot of trouble in R, as evidenced by previous questions:
- Change the values in a column
- Can R paste() output "\"?
- Replacing escaped double quotes by double quotes in R
- How to gsub('%', '\%', ... in R?
Many of these previous questions could be simplified to special cases of "How can I get \ out of my way?"
Is there a simple way to do this?
For example, I can find no arguments to gsub
that will remove all escapes from the following:
test <- c('\01', '\\001')