geom_bkde(mapping = NULL, data = NULL, stat = "bkde", position = "identity", bandwidth = NULL, range.x = NULL, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
stat_bkde(mapping = NULL, data = NULL, geom = "area", position = "stack", kernel = "normal", canonical = FALSE, bandwidth = NULL, gridsize = 410, range.x = NULL, truncate = TRUE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)bkde for details. If NULL,
it will be computed for you but will most likely not yield optimal
results.bkde for detailsFALSE (the default), removes missing values with
a warning. If TRUE silently removes missing values.NA, the default, includes if any aesthetics are mapped.
FALSE never includes, and TRUE always includes.FALSE, overrides the default aesthetics,
rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. borders.layer. There are
three types of arguments you can use here:
color = "red" or size = 3.
stat associated with the layer.
geom_bkde and stat_bkde.bkde for detailsbkde for detailsbkde for details.bkde
for detailsgeom_bkde understands the following aesthetics (required aesthetics
are in bold):
x
y
alpha
color
fill
linetype
size
A sample of the output from geom_bkde():
geom_bkde_01.pngoptions: width="100%" alt="Figure: geom_bkde_01.png"
geom_histogram, geom_freqpoly for
other methods of displaying continuous distribution.
See geom_violin for a compact density display.
data(geyser, package="MASS")
ggplot(geyser, aes(x=duration)) +
stat_bkde(alpha=1/2)
ggplot(geyser, aes(x=duration)) +
geom_bkde(alpha=1/2)
ggplot(geyser, aes(x=duration)) +
stat_bkde(bandwidth=0.25)
ggplot(geyser, aes(x=duration)) +
geom_bkde(bandwidth=0.25)
Run the code above in your browser using DataLab