Please read R FAQ 7.37. You need to escape the backslash: > z<- as.character("`X^`R\\`S") > z [1] "`X^`R\\`S" > cat(z) `X^`R\`S
Bert Gunter Genentech Nonclinical Statistics -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of mary guo Sent: Friday, January 29, 2010 1:58 PM To: r-help@r-project.org Subject: [R] How to use escape characters in a string Hi, I want to use a character as below in R, as.character("`X^`R\`S") [1] "`X^`R`S" Warning messages: 1: '\`' is an unrecognized escape in a character string 2: unrecognized escape removed from "`X^`R\`S" But I found errors. Can I use some option in as.character() to change this? Thanks Mary [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.