#' Title
#'
#' @param curve
#' @param x
#'
#' @return
#' @export
#'
#' @examples
get.curve.y <- function(curve, x = seq_along(curve)) {
if(sum(which(x < 1 | x > length(curve)))) return(NULL)
curve.y <- c()
ce <- ceiling(x)
fl <- floor(x)
curve.y[which(ce - fl == 0)] <- curve[fl][which(ce - fl == 0)]
curve.y[which(ce - fl != 0)] <-
((curve[ce] - curve[fl]) / (ce - fl) * (x - fl) + curve[fl])[which(ce - fl != 0)]
return(curve.y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.