#' helper function to format output to csvs
#'
#' @export
#' @param x dataframe to format
#' @param ... additional arguments to format
#' @details base::format does not appear to produce a data.frame so it can't be used with write_tsv. I typically use this with sci=FALSE to turn off scientific notation but it can also control significant digits, decimal places etc. see `format` for options.
format_numeric <- function(x,...) {
numeric_cols <- vapply(x, is.numeric, logical(1))
x[numeric_cols] <- lapply(x[numeric_cols], format, ...)
x
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.