\documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{mathpazo} \usepackage{color} \SWVweaveOpts{ codefmt="frame=single", prompt="", beforeout="\begin{quote}\color{blue}", afterout="\end{quote}" } \begin{document} \section*{Expressions in StatWeave} One subtlety of StatWeave is that you cannot embed an expression until a code chunk in that language is encountered. The way to work around it is to insert a blank code chunk. \begin{SWVcode} The \texttt{ChickWeight} data is one of the standard datasets in R. \begin{Rcode}{!echo} # Nothing here \end{Rcode} It has \Rexpr{nrow(ChickWeight)} observations. \begin{Rcode}{fig, scale=.5} summary(ChickWeight) plot(weight ~ Time, data=ChickWeight) \end{Rcode} From the plot, you can tell that the chicks grow at different rates. \end{SWVcode} Currently, a code chunk with no code at all causes an error. The comment line in the above example was needed. Maybe this will get fixed soon. \end{document}