compare.den {Boom} | R Documentation |
Compare several density estimates.
Description
Produces multiple density plots on a single axis, to compare the columns of a matrix or the elements of a list.
Usage
CompareDensities(x,
legend.text = NULL,
legend.location = "topright",
legend.title = NULL,
xlim = NULL,
ylim = NULL,
xlab = "parameter",
ylab = "density",
main = "",
lty = NULL,
col = "black",
axes = TRUE,
na.rm = TRUE,
...)
Arguments
x |
matrix or list of numeric vectors. A density plot is produced for each column of the matrix or element of the list. |
legend.text |
(optional) character vector giving names of each density plot. |
legend.location |
Entry that can be passed to
|
legend.title |
The legend title. |
xlim |
(optional) horizonal range of the plotting region. If
omitted the region will be sized to fit all the observations in
|
ylim |
(optional) vertical range of the plotting region. If omitted the region will be sized to fit all empirical density plots. |
xlab |
label to be placed on the horizontal axis |
ylab |
label to be placed on the vertical axis |
main |
main title for the plot |
lty |
The line types to use for the different densities. See
|
col |
vector of colors for the densities to be plotted. |
axes |
Logical. Should axes and a box be drawn around the figure? |
na.rm |
Logical value indicating whether |
... |
Other graphical parameters passed to
|
Value
Called for its side effect, which is to produce multiple density plots on the current graphics device.
Author(s)
Steven L. Scott
See Also
Examples
x <- t(matrix(rnorm(5000, 1:5, 1:5), nrow=5))
CompareDensities(x, legend.text=c("EJ", "TK", "JT", "OtherEJ", "TJ"),
col=rainbow(5), lwd=2)