[R] Sweave: printing an underscore in the output from an R command

2013-09-02 Thread David Epstein
I am working with Sweave and would like to print out into my latex document the result of the R command version$platform So what I first tried in my .Rnw document was \Sexpr{print(version$platform)}. However, the output from this command is the string x86_64-apple-darwin10.8.0 (without the

Re: [R] Sweave: printing an underscore in the output from an R command

2013-09-02 Thread ONKELINX, Thierry
17:38 Aan: r-help@r-project.org Onderwerp: [R] Sweave: printing an underscore in the output from an R command I am working with Sweave and would like to print out into my latex document the result of the R command version$platform So what I first tried in my .Rnw document was \Sexpr{print(version

Re: [R] Sweave: printing an underscore in the output from an R command

2013-09-02 Thread Duncan Murdoch
On 13-09-02 3:18 PM, David Epstein wrote: Dear Thierry, Your suggestion doesn't work on my version of R. Here's what I get gsub(_, \_, print(version$platform) Error: '\_' is an unrecognized escape in character string starting \_ print(gsub(_, \_, version$platform)) Error: '\_' is an

Re: [R] Sweave: printing an underscore in the output from an R command

2013-09-02 Thread Yihui Xie
-help-boun...@r-project.org] namens David Epstein [david.epst...@warwick.ac.uk] Verzonden: maandag 2 september 2013 17:38 Aan: r-help@r-project.org Onderwerp: [R] Sweave: printing an underscore in the output from an R command I am working with Sweave and would like to print out into my latex