to_json | R Documentation |
Takes a tidysummary object and converts it into JSON that is returned.
If the file
argument is supplied, the JSON is saved to a file
instead.
to_json(df, file = NULL, overwrite = FALSE, ...)
df |
a data frame. |
file |
file name to save. If file is |
overwrite |
whether to overwrite the file if it already exists. |
... |
other arguments passed on to |
Sends the data frame to jsonlite::toJSON()
.
A character vector of the table source code.
If file is not NULL
, however, nothing is returned.
tidysummary()
## Not run: data <- tidysummary(iris) to_json(data) to_json(data, file="summary.json") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.