This help topic is for R version 2.0.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/graphics/html/nclass.html
nclass {graphics}R Documentation

Compute the Number of Classes for a Histogram

Description

Compute the number of classes for a histogram, for use internally in hist.

Usage

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

Arguments

x

A data vector.

Details

nclass.Sturges uses Sturges' formula, implicitly basing bin sizes on the range of the data.

nclass.scott uses Scott's choice for a normal distribution based on the estimate of the standard error.

nclass.FD uses the Freedman-Diaconis choice based on the inter-quartile range.

Value

The suggested number of classes.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S-PLUS. Springer, page 112.

Freedman, D. and Diaconis, P. (1981) On the histogram as a density estimator: L_2 theory.