Learn R Programming

flextable (version 0.8.3)

plot.flextable: plot a flextable

Description

plots a flextable, either as a grid grob object or as a raster image and display the result in a new graphics window.

Usage

# S3 method for flextable
plot(x, method = c("grob", "webshot"), ...)

Arguments

x

a flextable object

method

the method to use for the plot, one of grob or webshot

...

additional arguments passed to gen_grob() if method is 'grob' and passed to as_raster() if method is 'webshot'.

Details

  • method grob, uses method gen_grob() to convert the flextable into a grid graphics grob object.

  • method webshot, uses method as_raster() to convert the flextable into a raster object. In that case packages webshot and magick are required.

See Also

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

Examples

Run this code
ftab <- flextable(head(mtcars))
ftab <- autofit(ftab)
if (FALSE) {
plot(ftab)
if (require("webshot")) {
  plot(ftab, method = "webshot")
}
}

Run the code above in your browser using DataLab