Probability Density Plots

Create Trellis probability density plots. A modified version of the plot is created if the data argument is a bigdata bdFrame (see the DETAILS).

USAGE:

densityplot(formula, cut, from, n=50, to, width,  
            window="gaussian", ...) 
The following arguments have special meaning within this function. The common meanings for these and all other arguments are listed separately under trellis.args.

ARGUMENTS:

formula
a formula in the form ~ x | g1 * g2 * ... however the given variables g1, g2, ... may be omitted. The x variable is a numeric response and is the data used in the probability density estimate. Given variables, on the right hand side of the vertical bar, are factors or shingles.
cut
fraction of width for controlling default values of from and to. For gaussian windows, cut=.75; otherwise, cut=.5.
from,to
the n estimated values of density are equally spaced between from and to. Default is range of data extended by width*cut.
n
the number of equally spaced points at which to estimate density.
width
width of the window. Default is width of histogram bar which is determined by log(length(x), base=2)+1 bars to cover the range of x. The standard error of a Gaussian window is width/4.
window
character string giving the type of window used in computation "cosine", "gaussian", "rectangular", "triangular" (one character is sufficient).

VALUE:

an object of class trellis, which is automatically plotted by print.trellis.

DETAILS:

If the data argument is a bdFrame then the densities are computed before the panel function is called. The default panel function used in this case is panel.xyplot.

SEE ALSO:

, ,

EXAMPLES:

densityplot( ~ height | voice.part, data=singer, layout=c(2, 4),  
            aspect= 1, xlab="Height (inches)", width=5)