[R] how to use \Sexpr{} with sweave

cryan at binghamton.edu cryan at binghamton.edu
Wed Oct 10 00:19:02 CEST 2007


Just goes to show, it helps to search the archives!

I discovered this in the R-help archives:

https://stat.ethz.ch/pipermail/r-help/2004-July/053920.html

And similarly, in the Sweave manual:

"A.16 After loading package R2HTML Sweave doesn’t work properly!

Package R2HTML registers an Sweave driver for HTML files, and after that the Syntax for HTML
is in the search list before the default syntax.
options(SweaveSyntax="SweaveSyntaxNoweb")
or calling Sweave like
Sweave(..., syntax="SweaveSyntaxNoweb")
ensures the default syntax even after loading R2HTML.A.16 After loading package R2HTML Sweave doesn’t work properly!
Package R2HTML registers an Sweave driver for HTML files, and after that the Syntax for HTML
is in the search list before the default syntax.

options(SweaveSyntax="SweaveSyntaxNoweb")
or calling Sweave like
Sweave(..., syntax="SweaveSyntaxNoweb")
ensures the default syntax even after loading R2HTML."

I use Tinn-R for my work, set up as per its instructions, so that when I open R, Tinn-R automatically opens, and in the process, it apparently loads R2HTML.  So this explains my problem.

Does anyone know where I should put "options(SweaveSyntax="SweaveSyntaxNoweb")?"  For what command is this an option?

Thanks.

--Chris Ryan

---- Original message ----
>Date: Sat,  6 Oct 2007 22:38:04 -0400 (EDT)
>From: <cryan at binghamton.edu>  
>Subject: [R] how to use \Sexpr{} with sweave  
>To: r-help at stat.math.ethz.ch
>
>I'm trying to learn Sweave.  So far things are going well with the chunks of code identified by << >>=
>
>But I'm having trouble with the in-line text use of \Sexpr.
>


More information about the R-help mailing list