Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

save_as_image

save a flextable as an image


Description

save a flextable as a png, pdf or jpeg image.

Image generated with package 'webshot' or package 'webshot2'. Package 'webshot2' should be prefered as 'webshot' can have issues with some properties (i.e. bold are not rendered for some users).

Usage

save_as_image(x, path, zoom = 3, expand = 10, webshot = "webshot")

Arguments

x

a flextable object

path

image file to be created. It should end with .png, .pdf, or .jpeg.

zoom, expand

parameters used by webshot function.

webshot

webshot package as a scalar character, one of "webshot" or "webshot2".

Note

This function requires package webshot or webshot2.

See Also

Examples

ft <- flextable( head( mtcars ) )
ft <- autofit(ft)
tf <- tempfile(fileext = ".png")
## Not run: 
if( require("webshot") ){
  save_as_image(x = ft, path = "myimage.png")
}

## End(Not run)

flextable

Functions for Tabular Reporting

v0.6.10
GPL-3
Authors
David Gohel [aut, cre], Clementine Jager [ctb], Quentin Fazilleau [ctb], Maxim Nazarov [ctb] (rmarkdown for docx output), Titouan Robert [ctb], Michael Barrowman [ctb] (inline footnotes), Atsushi Yasumoto [ctb] (support for bookdown cross reference), Paul Julian [ctb] (support for gam objects)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.