Trouble with fig.env in knitr?

I'm having trouble getting fig.env to work in knitr. Here's a simple example:

documentclass[12pt]{article}
usepackage{rotfloat}
begin{document}


<<setup, include=F, cache=F>>=
opts_chunk$set(comment=NA,fig.path=file.path(getwd(),'figure/minimal-'),tidy=F, fig.align='center',size='footnotesize')
options(replace.assign=TRUE, width=60)
@

Hoping for a sideways figure!
<<FIGURE, fig.env='sidewaysfigure',fig.width=10, fig.height=5>>=
plot(1:10,1:10)
@

end{document}

After knitting, all I get in the output .tex file for the figure is

{centering includegraphics[width=maxwidth]{D:/R/figure/minimal-FIGURE} 

}

Any suggestions for what could be going wrong?

sessionInfo() R version 3.0.0 (2013-04-03) Platform: x86_64-w64-mingw32/x64 (64-bit)


您需要fig.cap选项来处理与figure环境相关的所有工作,例如

<<FIGURE, fig.cap='A boring figure.', fig.env='sidewaysfigure', fig.width=10, fig.height=5>>=
plot(1:10,1:10)
@
链接地址: http://www.djcxy.com/p/77272.html

上一篇: ggplot包装命令文本

下一篇: 麻烦在knitr中使用fig.env?