[R] Backslash \ in string

Jannis bt_jannis at yahoo.de
Thu Jul 15 15:02:09 CEST 2010


Dear R community,


is there any way to include a backslash in a charakter string without meaning some escape sequence?

E.g. i need a string like:

a <- '\hline' 
Error: '\h' is an unrecognized escape in character string starting "\h"

to include some latex code in a xtable object, but I only mange to do:

a <- '\\hline'

which is not what I want.

In detail I would like to add the following line of code to the first row of an xtable object with the add.to.row argument:


& \multicolumn{4}{c}{A} \multicolumn{4}{c}{B} \\

for which I have to convert it into a character sting.

Any ideas?


Jannis





More information about the R-help mailing list