Convenient interface for plotting density estimates.
dens( x , adj=0.5 , norm.comp=FALSE , main="" , show.HPDI=FALSE , show.zero=FALSE , rm.na=TRUE , add=FALSE , ...)
Vector of values to construct density from, or data frame. If x
is a data frame, then dens
plots a grid of densities, one for each column in x
.
width of density kernal.
If TRUE
, overlays normal density comparison.
If a numeric value, displays HPDI of same width. For example, show.HPDI=0.95
shows a 95 percent HPDI inside the density.
If TRUE
, draws a vertical line at location of zero on horizonal axis.
If TRUE
, removes NA
s before computing density
If TRUE
, overlays density on an existing plot
Other parameters to pass to density
, which constructs the density estimates.
This function merely provides a convenient interface for plotting density estimates produced by density
. It handles both single vectors and multiple vectors, contained within a data frame.
Highest Posterior Density Intervals (HPDI) are calculated by HPDinterval
in the coda
package.