quarto_fig_chunk | R Documentation |
Assembles a Quarto knitr figure chunk.
quarto_fig_chunk(
body,
label,
fig_cap,
fig_subcap = NULL,
fig_column = "body",
fig_width = NULL,
fig_height = NULL,
fig_pos = "H",
fig_link = NULL,
out_width = NULL,
out_height = NULL
)
body |
R code to insert into the code chunk's body. A character scalar. |
label |
Unique code chunk label. Set as Quarto's |
fig_cap |
Figure caption. Set as Quarto's |
fig_subcap |
Figure subcaptions. Set as Quarto's |
fig_column |
Quarto article layout class for the figure output. Set as
Quarto's
|
fig_width |
Width of the plot (in inches), to be used in the graphics device. Set as Quarto's
|
fig_height |
Height of the plot (in inches), to be used in the graphics device. Set as Quarto's
|
fig_pos |
LaTeX figure position arrangement to be used in |
fig_link |
Hyperlink target for the figure. Set as Quarto's |
out_width |
Width of the plot in the output document, which can be different from its physical |
out_height |
Height of the plot in the output document, which can be different from its physical |
Use substitute together with deparse1()
to convert R expressions to a character scalar as expected by param body
:
deparse1(expr = substitute(do_something()), collapse = "\n")
A character scalar.
Other Quarto functions:
quarto_chunks()
,
quarto_tbl_chunk()
,
read_quarto_chunk_data()
salim::quarto_fig_chunk(body = "plot(cars)",
label = "fig-mtcars",
fig_cap = "Default plot for dataset `cars`",
fig_column = "page") |>
cat()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.