Usage
histogram(formula,
data,
type = c("percent", "count", "density"),
nint = if(is.factor(x)) length(levels(x))
else round(log2(length(x))+1),
endpoints = range(x[!na.x]),
breaks = if(is.factor(x)) seq(0.5, length = length(levels(x))
+ 1) else do.breaks(endpoints, nint),
equal.widths = FALSE,
...)densityplot(formula, data, n = 50, plot.points = TRUE, ref = FALSE,
...)
Arguments
formula
A formula of the form ~ x | g1 * g2 * ...
indicates that histograms of x
should be produced conditioned
on the levels of the (optional) variables g1,g2,...
. When
the conditioning variables g1,g2,...
data
optional data frame in which variables are to be
evaluated
type
Character string indicating type of histogram to be
drawn. ``percent'' and ``count'' give relative frequency and
frequency histograms, and can be misleading when breakpoints are not
equally spaced. ``density'' produces a density scale histogra
nint
Number of bins. Applies only when breaks
is
unspecified in the call.
endpoints
vector of length 2 indicating the range of x-values
that is to be covered by the histogram. Again, applies only when
breaks
is unspecified.
breaks
numeric vector of length = (number of bins + 1)
defining the breakpoints of the bins. Note that when breakpoints are
not equally spaced, the only value of type
that makes sense
is density. Usually all panels use the same brea
equal.widths
logical, relevant only when breaks=NULL
.
If TRUE
, equally spaced bins will be selected, otherwise,
approximately equal area bins will be selected (this would mean that
the breakpoints will not be equally space
n
number of points at which density is to be evaluated
plot.points
logical specifying whether the x
values
should be plotted.
ref
logical specifying whether a reference x-axis should be
drawn.
...
other arguments. In the case of densityplot
,
if the default panel function is used, then arguments appropriate to
density
can be included. This can control the details of how
the Kernel Density Estimates are calculate
synopsis
histogram(formula, data = parent.frame(), aspect = "fill", layout = NULL,
panel = panel.histogram, prepanel = NULL, scales = list(),
strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, type = c("percent",
"count", "density"), nint, endpoints = range(x[!is.na(x)]), breaks,
equal.widths = TRUE, ..., subscripts = !is.null(groups),
subset = TRUE)
densityplot(formula, data = parent.frame(), aspect = "fill", layout = NULL,
panel = panel.densityplot, prepanel = NULL, scales = list(),
strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, bw = NULL,
adjust = NULL, kernel = NULL, window = NULL, width = NULL,
give.Rkern = FALSE, n = 50, from = NULL, to = NULL, cut = NULL,
na.rm = NULL, ..., subscripts = !is.null(groups), subset = TRUE)