df_printer {flextable}R Documentation

data.frame automatic printing as a flextable

Description

Create a summary from a data.frame as a flextable. This function is to be used in an R Markdown document.

To use that function, you must declare it in the part df_print of the 'YAML' header of your R Markdown document:

---
df_print: !expr function(x) flextable::df_printer(x)
---

We notice an unexpected behavior with bookdown. When using bookdown it is necessary to use use_df_printer() instead in a setup run chunk:

use_df_printer()

Usage

df_printer(dat, ...)

Arguments

dat

the data.frame

...

unused argument

Details

'knitr' chunk options are available to customize the output:

See Also

Other flextable print function: as_raster(), 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

df_printer(head(mtcars))

[Package flextable version 0.9.6 Index]