getkde | R Documentation |
Modification of ggplot2::stat_density()
for kernel density estimates using a combination of the
Botev (2010) bandwidth selector and the Abramson (1982) adaptive kernel
bandwidth modifier.
getkde(
x,
from = NA,
to = NA,
bw = NA,
adaptive = TRUE,
log = FALSE,
n = 512,
weights = NULL,
...
)
x |
numeric vector. Ages |
from |
numeric. minimum age of the time axis. If NULL, this is set automatically |
to |
numeric. maximum age of the time axis. If NULL, this is set automatically |
bw |
numeric. the bandwidth of the KDE. If NULL, bw will be calculated automatically using the algorithm by Botev et al. (2010). |
adaptive |
logical flag controlling if the adaptive KDE modifier of Abramson (1982) is used |
log |
logical. transform the ages to a log scale if TRUE |
n |
integer. horizontal resolution (i.e., the number of segments) of the density estimate. |
weights |
numeric vector of non-negative observation weights, hence of
same length as |
... |
optional arguments to be passed on to R's density function. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.