subchunkify.Rd
Helper function that splits up a single written R chunk (in R Markdown) into multiple subchunks. This can be used to enable plotting multiple plots of different sizes and captions from within a single written R code chunk in R Markdown.
subchunkify(
g,
i,
fig_height = 12,
fig_width = 10,
caption = "''",
add_class = NULL,
other_args = ""
)
Plot or object to display in R Markdown output.
Chunk id. Should be unique for each plot or subchunk.
Height of plot or output of subchunk (in inches). See
fig.height
in the knitr chunk options.
Width of plot or output of subchunk (in inches). See
fig.width
in the knitr chunk options.
Figure or subchunk caption. Should be surrounded by two sets
of quotes, e.g., "'This is a valid caption.'" See fig.cap
in the
knitr chunk options.
Vector of css classes to add to object.
Other arguments to pass to knitr chunk header. Should be surrounded by two sets of quotes, e.g., "results='asis'".
Adapted from Michael James Williams.