#' A function to get the closest value from a vector
#' @export
closest <- function(x, y)
{
xy <- abs(x - y)
closest <- which(xy == min(xy))
names(closest) <- names(y)
return(closest)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.