Last chance! 50% off unlimited learning
Sale ends in
histogram
, making it simpler to obtain certain common
histogram adornments. This is done be resetting the default panel
and prepanel functions used by histogram.xhistogram(x, data = NULL, panel = panel.xhistogram, type = "density",
center = NULL, width = NULL, ...)xhistogramBreaks(x, center = NULL, width = NULL, nint, ...)
prepanel.xhistogram(x, breaks = xhistogramBreaks, ...)
panel.xhistogram(x, dcol = trellis.par.get("plot.line")$col, dalpha = 1,
dlwd = 2, gcol = trellis.par.get("add.line")$col, glwd = 2,
fcol = trellis.par.get("superpose.polygon")$col, dmath = dnorm,
verbose = FALSE, dn = 100, args = NULL, labels = FALSE,
density = NULL, under = FALSE, fit = NULL, start = NULL,
type = "density", v, h, groups = NULL, center = NULL, width = NULL,
breaks, nint = round(1.5 * log2(length(x)) + 1), stripes = c("vertical",
"horizontal", "none"), alpha = 1, ...)
x
'density'
, 'count'
, or 'percent'
hist
knows about given as a character string.
When using the
histogram
and (by default when the panel.xhistogram
.lwd
but affecting the density line and guide lines, respectivelydmath
"exponential"
, "normal"
, "lognormal"
, "poisson"
, "beta"
, "geometric"
,
"t"
fitdistr
histogram
"vertical"
, "horizontal"
, or "none"
, indicating
how bins should be striped when groups
is not NULL
xhistogramBreaks
returns a vector of break pointshistogram
histogram(~age | substance, HELPrct, v=35, fit='normal')
histogram(~age, HELPrct, labels=TRUE, type='count')
histogram(~age, HELPrct, groups=cut(age, seq(10,80,by=10)))
histogram(~age, HELPrct, groups=sex, stripes='horizontal')
histogram(~racegrp, HELPrct, groups=substance,auto.key=TRUE)
xhistogramBreaks(1:10, center=5, width=1)
xhistogramBreaks(1:10, center=5, width=2)
xhistogramBreaks(0:10, center=15, width=3)
xhistogramBreaks(1:100, center=50, width=3)
xhistogramBreaks(0:10, center=5, nint=5)
Run the code above in your browser using DataLab