#' Custom average of a vector.
#'
#' @description Works like the default 'mean' function but rounds the result
#' to three digits.
#' @param vec A list of numerics values
#' @return mean of vector rounded up to 3 digits
mean <- function(vec) {
# assert(
# check_class(vec, "numeric"),
# check_vector(vec),
# combine="and"
# )
round(base::mean(vec), 3)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.