# calculate the standard deviation
standard_deviation <- function(x) {
#' Calculate the standard deviation of a vector of numbers
#'
#'
#' @param a vector of numbers
#' @return numeric
#' @export
#' @examples
#'#' standard_deviation(c(1,2,3,4,5,6,7,8,9,10))
n <- length(x)
mean = sum(x) / n
ssq <- sum((x-mean)^2)
stddev = sqrt(ssq/n)
return(stddev)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.