[英]Using knitr to create HTML slide with separate output of just the R code
[英]knitr: Is there a way to make multiple output of R plotting into each slide?
假設我有一個R卡盤,例如:
\documentclass[xcolor=x11names,compress]{beamer}
\begin{frame}[fragile]{Visualization}
<<echo=FALSE, results="asis", fig.keep="all", tidy=TRUE>>=
library(knitr)
for (i in 1:100){
plot(rnorm(100))
}
@
\end{frame}
\end{document}
我的問題是如何使每張幻燈片中顯示的100個圖而不是保持在一張幻燈片中?
如果您提供“ allowframebreaks”選項,則Beamer可以拆分幻燈片。 多少頁似乎有一些限制,但這可行:
\documentclass[xcolor=x11names,compress]{beamer}
\begin{document}
\begin{frame}[allowframebreaks]{Visualization}
<<echo=FALSE, fig.height=4>>=
for (i in 1:10){
plot(rnorm(100))
}
@
\end{frame}
\end{document}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.