Default Panel Function for densityplot
panel.densityplot.RdThis is the default panel function for densityplot.
Usage
panel.densityplot(x, darg, plot.points = "jitter",
ref = FALSE,
groups = NULL,
weights = NULL,
jitter.amount,
type, ...,
grid = lattice.getOption("default.args")$grid,
identifier = "density")Arguments
- x
data points for which density is to be estimated
- darg
list of arguments to be passed to the
densityfunction. Typically, this should be a list with zero or more of the following components :bw,adjust,kernel,window,width,give.Rkern,n,from,to,cut,na.rm(seedensityfor details)- plot.points
logical specifying whether or not the data points should be plotted along with the estimated density. Alternatively, a character string specifying how the points should be plotted. Meaningful values are
"rug", in which casepanel.rugis used to plot a ‘rug’, and"jitter", in which case the points are jittered vertically to better distinguish overlapping points.- ref
logical, whether to draw x-axis
- groups
an optional grouping variable. If present,
panel.superposewill be used instead to display each subgroup- weights
numeric vector of weights for the density calculations. If this is specified, the
...part must also include asubscriptsargument that matches the weights tox.- jitter.amount
when
plot.points="jitter", the value to use as theamountargument tojitter.- type
typeargument used to plot points, if requested. This is not expected to be useful, it is available mostly to protect atypeargument, if specified, from affecting the density curve.- ...
extra graphical parameters. Note that additional arguments to
panel.rugcannot be passed on throughpanel.densityplot.- grid
A logical flag, character string, or list specifying whether and how a background grid should be drawn. In its general form,
gridcan be a list of arguments to be supplied topanel.grid, which is called with those arguments. Three shortcuts are available:TRUE:roughly equivalent to
list(h = -1, v = -1)"h":roughly equivalent to
list(h = -1, v = 0)"v":roughly equivalent to
list(h = 0, v = -1)
No grid is drawn if
grid = FALSE.- identifier
A character string that is prepended to the names of grobs that are created by this panel function.
Author
Deepayan Sarkar Deepayan.Sarkar@R-project.org