R/dens2func.R

"dens2func" <- function(x, ...){
    den1 <- density(x,...)
    f <- function(w) approx(den1$x, den1$y, w, yleft=0, yright=0)$y
    class(f) <- "dfun"
    f
}

Try the bioDist package in your browser

Any scripts or data that you put into this service are public.

bioDist documentation built on Nov. 8, 2020, 5:14 p.m.