powered by
Create an empirical cumulative distribution function (ECDF) from a given vector.
empirical_cumulative_distribution_function(data, sorted = FALSE)
An object representing the ECDF, with member function $ecdf(x) to evaluate the ECDF at point(s) x.
$ecdf(x)
x
A numeric vector of data points.
A logical indicating whether the data is already sorted. Default is FALSE.
data <- c(1.2, 2.3, 3.1, 4.5, 5.0) ecdf_obj <- empirical_cumulative_distribution_function(data) ecdf_obj$ecdf(3.0) # Evaluate ECDF at x = 3.0
Run the code above in your browser using DataLab