two column beamer/sweave slide with grid graphic

久未见 提交于 2019-12-02 18:44:45
  • As for the first question, the easy way is to set keep.source=TRUE in SweaveOpts. For more fancy control, see fancyvrb and FAQ #9 of Sweave manual.
  • The width of the figure can be set by \setkeys{Gin}{width=1.0\textwidth}

here is a slight modification:

... snip ...

\SweaveOpts{pdf=TRUE, echo=FALSE, fig=FALSE, eps=FALSE, tidy=T, width=4, height=4, keep.source=TRUE}

\title{Reproducible data analysis with \texttt{ggplot2} \& \texttt{R}}

... snip ...


\begin{document}
\setkeys{Gin}{width=1.1\textwidth}

... snip...

<<echo=TRUE,fig=FALSE>>=
library(ggplot2)
p <- 
  qplot(mpg,
        wt,
        data=mtcars,
        colour=cyl) +  
  theme_grey(base_family=
             "Helvetica")
@

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!