#'@export
step_cdf <- function(x, start, stop, p){
ix <- which(start < x & stop <= x)
c <- sum(p[ix])
if(any(start <x & stop > x)){
if(sum(start <x & stop > x) > 1) stop("error")
ix <- which(start <x & stop > x)
prop <- (x-start[ix])/(stop[ix]-start[ix])
c <- c + p[ix]*prop
}
return(c)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.