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.

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

...

additional arguments passed to other functions

Note

This function requires packages: webshot and magick.

Examples

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