to_markdown: Create a table in Markdown from a tidysummary

View source: R/converters.R

to_markdownR Documentation

Create a table in Markdown from a tidysummary

Description

Takes a tidysummary object and converts it into Markdown that is returned. If the file argument is supplied, the Markdown is saved to a file instead.

Usage

to_markdown(df, file = NULL, overwrite = FALSE, column_quotes = FALSE, ...)

Arguments

df

a data frame.

file

file name to save. If file is NULL, then the output is returned. Otherwise, there is no output.

overwrite

whether to overwrite the file if it already exists.

column_quotes

whether to use quotes around column names.

...

other arguments passed on to knitr::kable().

Details

Sends the data frame to knitr::kable().

Value

A character vector of the table source code.

See Also

tidysummary()

Examples

## Not run: 
data <- tidysummary(iris)

to_markdown(data)
to_markdown(data, file="summary.md")

## End(Not run)

peterdalle/tidysummary documentation built on March 27, 2022, 4:30 p.m.