scale
|
Numeric. Controls the scaling factor of each plot. Values greater than 1 means that plots overlap.
|
joint.max
|
character indicating how to scale the maximum of the densities: The default “all” indicates that all densities are scaled jointly relative to the same maximum so that the areas of all densities are comparable. Alternatively, “facet” indicates that the maximum is computed within each facet so that the areas of the densities are comparable within each facet but not necessarily across facets. Finally, “by” indicates that each row (in each facet) is scaled separately, so that the areas of the densities for by groups in the same row are comparable but not necessarily across rows.
|
breaks
|
Numeric. If a color gradient is used for shading, the breaks between the colors can be modified. The default is to use equidistant breaks spanning the range of the x variable.
|
probs
|
Numeric. Instead of specifying the same breaks on the x-axis for all groups, it is possible to specify group-specific quantiles at the specified probs . The quantiles are computed based on the density (rather than the raw original variable). Only one of breaks or probs must be specified.
|
ylevels
|
a character or numeric vector specifying in which order the levels of the y-variable should be plotted.
|
bw
|
the smoothing bandwidth to be used. The kernels are scaled such that this is the standard deviation of the smoothing kernel. (Note this differs from the reference books cited below.)
bw can also be a character string giving a rule to choose the bandwidth. See bw.nrd . The default, “nrd0” , has remained the default for historical and compatibility reasons, rather than as a general recommendation, where e.g., “SJ” would rather fit, see also Venables and Ripley (2002).
The specified (or computed) value of bw is multiplied by adjust .
|
joint.bw
|
character string indicating whether (and how) the smoothing bandwidth should be computed from the joint data distribution. The default of “mean” will compute the joint bandwidth as the mean of the individual subgroup bandwidths (weighted by their number of observations). Choosing “full” will result in a joint bandwidth computed from the full distribution (merging all subgroups). For “none” the individual bandwidth will be computed independently for each subgroup. Also accepts a logical argument, where TRUE maps to “mean” and FALSE maps to “none” . See type_density for some discussion of practical considerations.
|
adjust
|
the bandwidth used is actually adjust*bw . This makes it easy to specify values like ‘half the default’ bandwidth.
|
kernel
|
a character string giving the smoothing kernel to be used. This must partially match one of “gaussian” , “rectangular” , “triangular” , “epanechnikov” , “biweight” , “cosine” or “optcosine” , with default “gaussian” , and may be abbreviated to a unique prefix (single letter).
“cosine” is smoother than “optcosine” , which is the usual ‘cosine’ kernel in the literature and almost MSE-efficient. However, “cosine” is the version used by S.
|
n
|
the number of equally spaced points at which the density is to be estimated. When n > 512 , it is rounded up to a power of 2 during the calculations (as fft is used) and the final result is interpolated by approx . So it almost always makes sense to specify n as a power of two.
|
gradient
|
Logical or character. Should a gradient fill be used to shade the area under the density? If a character specification is used, then it can either be of length 1 and specify the palette to be used with gradient = TRUE corresponding to gradient = “viridis” . If a character vector of length greater than 1 is used, then it should specify the colors in the palette, e.g., gradient = hcl.colors(512) .
|
raster
|
Logical. Should the gradient fill be drawn using rasterImage ? Defaults to FALSE , in which case the gradient fill will instead be drawn using polygon . See the Technical note on gradient fills section below.
|
col
|
Character string denoting the outline (border) color for all of the ridge densities. Note that a singular value is expected; if multiple colors are provided then only the first will be used. This argument is mostly useful for the aesthetic effect of drawing a common outline color in combination with gradient fills. See Examples.
|
alpha
|
Numeric in the range [0,1] for adjusting the alpha transparency of the density fills. In most cases, will default to a value of 1, i.e. fully opaque. But for some by grouped plots (excepting the special cases where by==y or by==x ), will default to 0.6.
|