#' essentially the same as ecdf, but over-writes the max value with the next largest quantile
quantile_estimate = function(x) {
i = which( is.finite( x) )
pr = ecdf(x[i]) ( x[i] )
ix = which( pr ==1 )
if ( !{ length(ix) %in% c(0, length(x)) } ) pr[ix] = max( pr[-ix] )
x[i] = pr
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.