as_raster: Transform a flextable into a raster

View source: R/printers.R

as_rasterR Documentation

Transform a flextable into 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.

The function is no longer very useful since gen_grob() exists and will be deprecated in a future version.

Usage

as_raster(x, ...)

Arguments

x

a flextable object

...

additional arguments passed to other functions

Note

This function requires package 'magick'.

See Also

Other flextable print function: df_printer(), flextable_to_rmd(), gen_grob(), htmltools_value(), knit_print.flextable(), plot.flextable(), print.flextable(), save_as_docx(), save_as_html(), save_as_image(), save_as_pptx(), save_as_rtf(), to_html.flextable()

Examples

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

## End(Not run)

flextable documentation built on Oct. 23, 2023, 1:07 a.m.