#' Round numeric values of a data.frame
#'
#' @param df a data.frame
#' @param digits an integer
#'
#' @return a rounded data.frame
#' @export
round_df <- function(df, digits) {
nums <- vapply(df, is.numeric, FUN.VALUE = logical(1))
df[,nums] <- round(df[,nums], digits = digits)
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.