flextable_to_rmd | R Documentation |
Print flextable in R Markdown or Quarto documents
within for
loop or if
statement.
The function is particularly useful when you want to generate flextable in a loop from a R Markdown document.
Inside R Markdown document, chunk option results
must be
set to 'asis'.
See knit_print.flextable for more details.
flextable_to_rmd(x, ...)
x |
a flextable object |
... |
unused argument |
Other flextable print function:
as_raster()
,
df_printer()
,
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()
## Not run:
library(rmarkdown)
if (pandoc_available() &&
pandoc_version() > numeric_version("2")) {
demo_loop <- system.file(
package = "flextable",
"examples/rmd",
"loop_with_flextable.Rmd"
)
rmd_file <- tempfile(fileext = ".Rmd")
file.copy(demo_loop, to = rmd_file, overwrite = TRUE)
render(
input = rmd_file, output_format = "html_document",
output_file = "loop_with_flextable.html"
)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.