The empirical cumulative distribution function (ECDF) provides an alternative
visualisation of distribution. Compared to other visualisations that rely on
density (like geom_histogram()
), the ECDF doesn't require any
tuning parameters and handles both continuous and categorical variables.
The downside is that it requires more training to accurately interpret,
and the underlying visual tasks are somewhat more challenging.
stat_ecdf( mapping = NULL, data = NULL, geom = "step", position = "identity", ..., n = NULL, pad = TRUE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping | Set of aesthetic mappings created by |
---|---|
data | The data to be displayed in this layer. There are three options: If A A |
geom | The geometric object to use display the data |
position | Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... | Other arguments passed on to |
n | if NULL, do not interpolate. If not NULL, this is the number of points to interpolate with. |
pad | If |
na.rm | If |
show.legend | logical. Should this layer be included in the legends?
|
inherit.aes | If |
The statistic relies on the aesthetics assignment to guess which variable to use as the input and which to use as the output. Either x or y must be provided and one of them must be unused. The ECDF will be calculated on the given aesthetic and will be output on the unused one.
cumulative density corresponding x