R ignore escape sequence

Viewed 109

I want to write string "\s"
So I wrote print("\s") then R printed error
Error: '\s' is an unrecognized escape in character string starting ""\s"
So then I tried print("\\s") in hope that I will obtain what I want. However, as a surprise R printed
[1] "\\s" .... "Maybe, this is right and R showed me string with escape"
However, I really want
[1] "\s"
Is there a way how can I obtain "\s" ?
This whole is a part of bigger problems of escaping \ in latex.
For example print("\f") is no problem at all. I know "\f" is a valid escape sequence.

0 Answers
Related