ShadedDensity: Plot the distribution of a variable with a tail shaded

Description Usage Arguments See Also Examples

View source: R/ShadedDensity.R

Description

Plot the distribution of a variable with a tail shaded. Annotate with the area of the shaded region.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

ShadedDensityCenter

Examples

1
2
3
4
5
6
7
set.seed(52523)
d = data.frame(meas=rnorm(100))
threshold = -1.5
WVPlots::ShadedDensity(d, "meas", threshold,
                       title="Example shaded density plot, left tail")
WVPlots::ShadedDensity(d, "meas", -threshold, tail="right",
                       title="Example shaded density plot, right tail")

WVPlots documentation built on Jan. 10, 2021, 6:09 p.m.