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

cryan at binghamton.edu cryan at binghamton.edu
Sun Oct 7 20:53:00 CEST 2007


Duncan--

The .tex file that you describe as output of Sweave("test.Rnw") is what I had expected.  But I get this .tex file when I run Sweave:

\documentclass[12pt]{article}
\usepackage[margin=1.25in]{geometry}
\usepackage{graphicx}
\usepackage{Sweave}

\begin{document}

\begin{Schunk}
\begin{Sinput}
> pnorm(1)
\end{Sinput}
\begin{Soutput}
[1] 0.8413447
\end{Soutput}
\end{Schunk}


\Sexpr{2+6}

\end{document}\documentclass[12pt]{article}
\usepackage[margin=1.25in]{geometry}
\usepackage{graphicx}
\usepackage{Sweave}

\begin{document}

\begin{Schunk}
\begin{Sinput}
> pnorm(1)
\end{Sinput}
\begin{Soutput}
[1] 0.8413447
\end{Soutput}
\end{Schunk}


\Sexpr{2+6}

\end{document}



More information about the R-help mailing list