xhistogram: Augmented histograms

Description

The mosaic package adds some additional functionality to
lattice::histogram(), making it simpler to obtain certain common
histogram adornments. This is done be resetting the default panel
and prepanel functions used by histogram.

start

numeric value passed to MASS::fitdistr()

type

one of 'density', 'count', or 'percent'

h, v

a vector of values for additional horizontal and vertical lines

groups

as per lattice::histogram()

stripes

one of "vertical", "horizontal", or "none", indicating
how bins should be striped when groups is not NULL

alpha

transparency level

panel

a panel function

Details

The primary additional functionality added to histogram()
are the arguments width and center which provide a simple
way of describing equal-sized bins, and fit which can be used to
overlay the density curve for one of several distributions. The
groups argument can be used to color the bins. The primary use
for this is to shade tails of histograms, but there may be other uses
as well.

Value

xhistogramBreaks returns a vector of break points

Note

Versions of lattice since 0.20-21 support setting custom defaults
for breaks, panel, and prepanel used by
histogram(), so xhistogram() is no longer needed.
As a result, xhistogram()
(which was required in earlier versions of mosaic
is no longer needed and has been removed.

Example output

Loading required package: dplyr
Attaching package:'dplyr'
The following objects are masked from 'package:stats':filter,lag
The following objects are masked from 'package:base':intersect,setdiff,setequal,union
Loading required package: lattice
Loading required package: ggformula
Loading required package: ggplot2
New to ggformula? Try the tutorials:
learnr::run_tutorial("introduction", package ="ggformula")
learnr::run_tutorial("refining", package ="ggformula")
Loading required package: mosaicData
Loading required package: Matrix
The 'mosaic' package masks several functions from core packages inorder to add
additional features. The original behavior of these functions should not be affected by this.
Note: If you use the Matrix package, be sure to load it BEFORE loading mosaic.
Attaching package:'mosaic'
The following object is masked from 'package:Matrix':mean
The following objects are masked from 'package:dplyr':count,do,tally
The following objects are masked from 'package:stats':IQR,binom.test,cor,cor.test,cov,fivenum,median,prop.test,quantile,sd,t.test,var
The following objects are masked from 'package:base':max,mean,min,prod,range,sample,sum[1]-1.251.253.756.258.7511.25