to_html: Create a table in HTML from a tidysummary

View source: R/converters.R

to_htmlR Documentation

Create a table in HTML from a tidysummary

Description

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

Usage

to_html(df, file = NULL, overwrite = 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.

...

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

Details

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

Value

A character vector of the table source code. If file is not NULL, however, nothing is returned.

See Also

tidysummary()

Examples

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

to_html(data)
to_html(data, file="summary.html")

## End(Not run)

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