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

as_raster

get a flextable as a raster


Description

save a flextable as an image and return the corresponding raster. This function has been implemented to let flextable be printed on a ggplot object.

Usage

as_raster(x, zoom = 2, expand = 2, webshot = "webshot")

Arguments

x

a flextable object

zoom, expand

parameters used by webshot function.

webshot

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

Note

This function requires packages: webshot and magick.

See Also

Examples

ft <- qflextable( head( mtcars ) )
## Not run: 
if( require("ggplot2") && require("webshot") ){
  print(qplot(speed, dist, data = cars, geom = "point"))
  grid::grid.raster(as_raster(ft))
}

## 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.