[R] Using sweave

Christophe Declercq cdeclercq at nordnet.fr
Fri Feb 18 18:18:51 CET 2005



> De : r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]De la part de
> Matthieu Cornec
> Envoye : vendredi 18 fevrier 2005 17:40
>
> hello,
>
> Suppose in Rnw file, I compute a numeric of name x
> containing the value 1.
> In my tex file, I want to write
>
> Let x= "the real value of x"
> so that I can see in my dvi file : Let x = 1,
> with 1, the actual value of x written in a math
> environnement for example.

Try the \Sexpr{} command in LaTeX (see the Sweave manual). It's OK for
a scalar.

For example, something like this in the body of your LaTeX file should
do what you want:

<<>>=
x<-1
@

Let $x=\Sexpr{x}$


Christophe




More information about the R-help mailing list