- mapping
Set of aesthetic mappings created by aes()
or
aes_()
. If specified and inherit.aes = TRUE
(the
default), it is combined with the default mapping at the top level of the
plot. You must supply mapping
if there is no plot mapping.
- data
The data to be displayed in this layer. There are three
options:
If NULL
, the default, the data is inherited from the plot
data as specified in the call to ggplot()
.
A data.frame
, or other object, will override the plot
data.
A function
will be called with a single argument,
the plot data. The return value must be a data.frame.
, and
will be used as the layer data.
- geom
The geometric object to use to display the data.
- position
Position adjustment, either as a string, or the result of
a call to a position adjustment function.
- na.rm
If FALSE
, the default, missing values are removed with
a warning. If TRUE
, missing values are silently removed.
- show.legend
logical. Should this layer be included in the legends?
NA
, the default, includes if any aesthetics are mapped.
FALSE
never includes, and TRUE
always includes.
- inherit.aes
If FALSE
, overrides the default aesthetics,
rather than combining with them.
- bandwidth
Bandwidth used for density calculation. If not provided, is estimated from the data.
- from, to
The left and right-most points of the grid at which the density is to be estimated,
as in density()
. If not provided, these are estimated from the data range and the bandwidth.
- jittered_points
If TRUE
, carries the original point data over to the processed data frame,
so that individual points can be drawn by the various ridgeline geoms. The specific position of these
points is controlled by various position objects, e.g. position_points_sina()
or position_raincloud()
.
- quantile_lines
If TRUE
, enables the drawing of quantile lines. Overrides the calc_ecdf
setting
and sets it to TRUE
.
- calc_ecdf
If TRUE
, stat_density_ridges
calculates an empirical cumulative distribution function (ecdf)
and returns a variable ecdf
and a variable quantile
. Both can be mapped onto aesthetics via
stat(ecdf)
and stat(quantile)
, respectively.
- quantiles
Sets the number of quantiles the data should be broken into. Used if either calc_ecdf = TRUE
or quantile_lines = TRUE
. If quantiles
is an integer then the data will be cut into that many equal quantiles.
If it is a vector of probabilities then the data will cut by them.
- quantile_fun
Function that calculates quantiles. The function needs to accept two parameters,
a vector x
holding the raw data values and a vector probs
providing the probabilities that
define the quantiles. Default is quantile
.
- n
The number of equally spaced points at which the density is to be estimated. Should be a power of 2. Default
is 512.
- ...
other arguments passed on to layer()
. These are
often aesthetics, used to set an aesthetic to a fixed value, like
color = "red"
or linewidth = 3
. They may also be parameters
to the paired geom/stat.