nclass
Compute the Number of Classes for a Histogram

Description

Computes the number of bins for a histogram.

Usage

nclass.FD(x)
nclass.scott(x)
nclass.Sturges(x)

Arguments

x a numeric vector. NAs are allowed.

Details

These functions are based on the nclass functions described in Venables and Ripley (1999).
Value
returns the number of bins. If bandwidth is negative or zero, the number of bins is 1.
References
Venables, W. N. and Ripley, B. D. 1999. Modern Applied Statistics with S-PLUS. Third Editiion. New York, NY: Springer.
See Also
hist
Examples
PetalWidth <- Sdatasets::iris$Petal.Width)
nclass.FD(PetalWidth)
nclass.scott(PetalWidth)
nclass.Sturges(PetalWidth)
Package grDevices version 6.1.4-13
Package Index