ShadedDensityCenter {WVPlots} | R Documentation |
Plot the distribution of a variable with a center region shaded
Description
Plot the distribution of a variable with a center region shaded. Annotate with the area of the shaded region.
Usage
ShadedDensityCenter(
frame,
xvar,
boundaries,
title,
...,
linecolor = "darkgray",
shading = "darkblue",
annotate_area = TRUE
)
Arguments
frame |
data frame to get values from |
xvar |
name of the variable to be density plotted |
boundaries |
vector of the min and max boundaries of the shaded region |
title |
title to place on plot |
... |
no unnamed argument, added to force named binding of later arguments. |
linecolor |
color of density curve |
shading |
color of shaded region and boundaries |
annotate_area |
if TRUE (default), report the area of the shaded region |
See Also
Examples
if (requireNamespace('data.table', quietly = TRUE)) {
# don't multi-thread during CRAN checks
data.table::setDTthreads(1)
}
set.seed(52523)
d = data.frame(meas=rnorm(100))
boundaries = c(-1.5, 1.5)
WVPlots::ShadedDensityCenter(d, "meas", boundaries,
title="Example center-shaded density plot")
[Package WVPlots version 1.3.8 Index]