#' Return the sample variance of a vector, after removing NAs, and round.
#'
#' @param x Vectors of data.
#' @param round_n Number of digits to round to.
#' @description Written for use in the tables::tabular function to create publication-ready tables.
#' @export
Variance <- function(x, round_n=3) stats::var(x, na.rm=TRUE) %>% round(round_n)
#' Return the population variance of a vector, after removing NAs, and round.
#'
#' @param x Vectors of data.
#' @description Written for use in the tables::tabular function to create publication-ready tables.
#' @export
PopVariance <- function(x) {
temp <- sum((x-mean(x))^2)/length(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.