View source: R/preview-standalone.R
st_as_image | R Documentation |
Use this function to turn an stable object in to a high-quality pdf file,
The result can be included in an Rmarkdown file rendered to .html
or
other uses.
st_as_image(x, ...)
## S3 method for class 'stable'
st_as_image(
x,
width = getOption("pmtables.image.width", 0.95),
border = getOption("pmtables.image.border", "0.2cm 0.7cm"),
...
)
## S3 method for class 'pmtable'
st_as_image(x, ...)
## S3 method for class 'stobject'
st_as_image(x, ...)
x |
an stable object; this can be the result of calling |
... |
arguments passed to |
width |
the relative width of the image; passed to |
border |
passed as an option to |
This function depends on the magick and pdftools packages being installed.
First, x
is rendered with st_aspdf()
Next, the pdf file is read using magick::image_read_pdf()
Finally, the image is possibly resized via st_image_show()
A possibly resized magick
image object (see magick::image_read_pdf()
).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.