Skip to content
Prev 31113 / 63421 Next

sub and gsub treat \\ incorrectly (PR#13454)

On Tue, 20 Jan 2009, Andriy Miranskyy wrote:

            
Yes.  gsub("([_&])", "\\\\\\1", x) -- but you will also need to escape 
$ and %.  There are examples in the experimental Rd2tex function in 
the development version of R.

Please stop misusing the bug repository to ask questions (and to 
report your non-reading of the documentation: this is in ?regex 
referenced from ?sub, 'explicitly', pace Bill).