Defining control parameters for charts globally in knitr

To control the size of the graph in knitr

I use the following code

<< label = Plot1, fig.width=5, fig.height=5, out.width=.7\linewidth, fig.keep = all>>=


I wonder how to define these control parameters for charts globally instead of defining each chart. Thanks for your help and time.


source to share

1 answer

What about

\SweaveOpts{fig.width=5, fig.height=5, out.width=".7\\linewidth", fig.keep = "all"}


? I changed them to work with knitr version 0.3, which requires the parameter values ​​to be in valid R syntax ...



All Articles