knitFig | R Documentation |
This function was written to make it easy to knit figures with different, or dynamically generated, widths and heights (and captions) in the same chunk when working with R Markdown.
knitFig(
plotToDraw,
template = getOption("ufs.knitFig.template", NULL),
figWidth = ufs::opts$get("ggSaveFigWidth"),
figHeight = ufs::opts$get("ggSaveFigHeight"),
figCaption = "A plot.",
chunkName = NULL,
returnRaw = FALSE,
catPlot = ufs::opts$get("knitFig.catPlot"),
...
)
plotToDraw |
The plot to draw, e.g. a |
template |
A character value with the |
figWidth |
The width to set for the figure (in inches). |
figHeight |
The height to set for the figure (in inches). |
figCaption |
The caption to set for the figure. |
chunkName |
Optionally, the name for the chunk. To avoid problems
because multiple chunks have the name " |
returnRaw |
Whether to |
catPlot |
Whether to use the |
... |
Any additional arguments are passed on to
|
This function returns nothing, but uses knitr::knit_expand()
and knitr::knit()
to base::cat()
the result.
Gjalt-Jorn Peters
Maintainer: Gjalt-Jorn Peters ufs@opens.science
knitr::knit_expand()
and knitr::knit()
## Not run:
ufs::knitFig(
ufs::ggBoxplot(
mtcars,
'mpg'
)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.