Ecdf
returns a list whereas ecdf
returns a function. It's a lot easier to use the R-stats function ecdf
than it is to use something tortured like: Ecdf(.)$y[ min(which(Ecdf(.)$x>val))]
. If you want the value of ecdf(x=0) from an Ecdf-object
then this should work:
ecdf( Ecdf(rnorm(20), lwd = 2)$x ) (v=0)
[1] 0.5238095
(It turns out that the formal parameter for the function returned by ecdf
is "v".) But if you want the less elegant method and you already have assigned the result to an object named 'oneEcdf':
oneEcdf <- Ecdf(rnorm(20), lwd = 2)
oneEcdf$y[ min( which(oneEcdf$x > 0 ))]
[1] 0.6