ShadedDensity {WVPlots} | R Documentation |
Plot the distribution of a variable with a tail shaded
Description
Plot the distribution of a variable with a tail shaded. Annotate with the area of the shaded region.
Usage
ShadedDensity(
frame,
xvar,
threshold,
title,
...,
tail = "left",
linecolor = "darkgray",
shading = "darkblue",
annotate_area = TRUE
)
Arguments
frame |
data frame to get values from |
xvar |
name of the variable to be density plotted |
threshold |
boundary value for the tail |
title |
title to place on plot |
... |
no unnamed argument, added to force named binding of later arguments. |
tail |
which tail to shade, 'left' (default) or 'right' |
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))
threshold = -1.5
WVPlots::ShadedDensity(d, "meas", threshold,
title="Example shaded density plot, left tail")
if (FALSE) {
WVPlots::ShadedDensity(d, "meas", -threshold, tail="right",
title="Example shaded density plot, right tail")
}
[Package WVPlots version 1.3.8 Index]