#' Sample Mean
#'
#' @param x a vector
#'
#' @return xbar: the sample mean
#' @export
#'
#' @examples samp_mean(c(1,2,3))
samp_mean <- function(x) {
xsum <- 0
for(xj in x) {
xsum <- xsum + xj
}
xbar = xsum / length(x)
return(xbar)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.