I have read that if you want to insert a backslash in a string you need to escape it:
a <- "\\"
The problem is that if I do that I get two slashes in my string!
> a <- "\\"
> a
[1] "\\"
How can I get just one single backslash in my string?
I have read that if you want to insert a backslash in a string you need to escape it:
a <- "\\"
The problem is that if I do that I get two slashes in my string!
> a <- "\\"
> a
[1] "\\"
How can I get just one single backslash in my string?
You don't actually get two backslashes--that's actually a single character :-)
Test it out:
a <- "\\"
nchar(a)
# [1] 1
cat(a)
# \