Write a data frame or a list of data frames in a markdown document converted #' in various format using pandoc.

tblDown(
  x,
  output_file = "./tables.docx",
  section = NULL,
  caption = NULL,
  title = NULL,
  row.names = FALSE,
  ...
)

Arguments

x

a data frame or a list of data frames.

output_file

path to the output file. Its extension will be used by pandoc to correctly render the final document in the write format.

section

a vector of character strings used as section titles (optional).

caption

a vector of character strings used as captions (optional).

title

a character string used as a title for the document (optional).

row.names

a logical. Should row names be added? See knitr::kable().

...

further arguments passed to knitr::kable().

Value

A data frame whose columns have the desired classes.

Details

This function calls base::cat() and knitr::kable() to write a Markdown document containing a list of tables that is then converted into the desired format. For section and caption if the length differ then will be cut off or expanded.

References

https://pandoc.org/MANUAL.html#tables

Examples

if (FALSE) { data(CO2) tblDown(list(CO2[1:2, ], CO2[3:6,]), section = "section") tblDown(list(CO2[1:2, ], CO2[3:6,]), "./tables.pdf") }