stat_logspline.Rd
Computes logspline density (+ counts estimate), probability, survival & hazard
stat_logspline(mapping = NULL, data = NULL, geom = "area", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, n = 100, max_knots = 0, n_knots = 0, min_d = -1, error_action = 2, ...)
mapping | Set of aesthetic mappings created by |
---|---|
data | The data to be displayed in this layer. There are three options: If A A |
geom | Use to override the default connection between
|
position | Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm | If |
show.legend | logical. Should this layer be included in the legends?
|
inherit.aes | If |
n | numbe of points for the density estimation (larger == smoother) |
max_knots | the maximum number of knots. The routine stops adding knots when this number of knots is reached. The method has an automatic rule for selecting maxknots if this parameter is not specified. |
n_knots | forces the method to start with nknots knots. The method has an automatic rule for selecting nknots if this parameter is not specified. |
min_d | minimum distance, in order statistics, between knots. |
error_action | see |
... | Other arguments passed on to |
density
: the density estimate
count
: computed counts (similar to ggplot2::stat_density()
)
probs
: distribution function
survival
: survival function
hazard
: hazard function
By default the y
aesthetic is mapped to stat(density)
# NOT RUN { library(ggplot2) set.seed(1) data.frame( val = rnorm(100) ) -> xdf ggplot(xdf) + stat_logspline(aes(val)) # }