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

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

Examples

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