#' Calculate Area Under Curve (AUC) using trapesium approximation
#'
#' @param x vector of x values
#' @param y vector of y values
#' @export
#'
calcAUC <- function(x, y) {
sum(diff(x) * (head(y,-1)+tail(y,-1)))/2
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.