#' This function calculates the variance to mean ratio (also known as dispersion index).
#' @param x is a numeric vector.
#' @return Returns the dispersion index.
dispersion <- function(x) {
var(x) / mean(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.