I have tried the following to set figure width with knitr and LaTeX:
\documentclass{paper}
\begin{document}
<<fig.width=\textwidth>>
x = runif(1000)
plot(x)
@
\end{document}
However, I get the following error:
<to be read again>
>
l.54 <<fig.width=\textwidth>
>
What am I doing wrong?