Hi Francesco,
This is an advanced topic in knitr; it is called a chunk hook:
http://yihui.name/knitr/hooks
Sorry for the confusion on the name "par"; you can call it anything, e.g. mypar
knit_hooks$set(mypar = function(before, options, envir) {
if (before) par(mar = c(4, 4, .1, .1))
})
opts_ch
Dear Yihui,
thanks a lot for your kind reply. Your solution is very elegant and
versatile.
However, there is a point that is obscure to me and I didn't manage to
fully understand them after looking at the Knitr manual and graphic manual.
The issue concerns the hook:
*knit_hooks$set(par = function
All you mentioned are possible; knitr has very comprehensive support
to figures in LaTeX, and what you want in this case is subfigures
(\usepackage{subfig}); here is an example:
https://github.com/yihui/knitr-examples/blob/master/067-graphics-options.Rnw
(search for 'fig.subcap' for the relevant ch
On 01/08/2013 04:17 AM, Francesco Sarracino wrote:
Dear R helpers,
I am using knitr to run analysis with R and edit my document with Latex. I
am wondering whether there is a way to include 2 or more pictures per chunk
and being able to refer them in the text independently and eventually
whether
Dear R helpers,
I am using knitr to run analysis with R and edit my document with Latex. I
am wondering whether there is a way to include 2 or more pictures per chunk
and being able to refer them in the text independently and eventually
whether it is possible to give them different captions. Let m
5 matches
Mail list logo