#' Get the nth maximum value
#'
#' @export
nmax <- function(x, n=2){
len <- length(x)
if(n > len){
warning('n greater than length(x). Setting n=length(x)')
n <- length(x)
}
sort(x,partial=len-n+1)[len-n+1]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.