
Show table output that has been saved to pdf or png format
Source:R/preview-standalone.R
st_image_show.RdShow table output that has been saved to pdf or png format
Arguments
- path
path to a png or pdf file saved on disk.
- width
for resizing the magick object; must be a value greater than 0 and less than or equal to 1; when not knitting, the width is taken as a fraction of the current graphics device width; when knitting and the image is in png format, the width is taken to be a fraction of the available space; this parameter is ignored when knitting pdf output.
- knitting
if
TRUE, the context is assumed to be document knit (see default) and the magick object is returned after resizing; ifFALSE, then interactive context is assumed and the magick object is returned after resizing according to the current device width.
Details
This function requires the magick and pdftools packages to be installed.
If you are not knitting an rmarkdown document, then the image is read
using magick::image_read_pdf() (pdf files) or magick::image_read()
(png files) and resized relative to the width of the current graphics
device (see grDevices::dev.size()).
If you are knitting with pdf output, then the image is read in
using magick::image_read_pdf() and passed through
knitr::include_graphics() without resizing. If you are knitting with html
output, then the image is read in using magick::image_read()
and resized using magick::image_resize() to a certain fraction of the
available space (see width argument).