nclass.hist | R Documentation |
Computes the optimal number of classes/bins for an histogram as the
maximum between the Sturges and Freedman-Diaconis (FD) estimators.
For small datasets the Sturges value will usually be chosen, while
larger datasets will usually default to FD. Avoids the overly
conservative behaviour of FD and Sturges for small and large
datasets, respectively.
This is the default option in numpy.histogram_bin_edges
available
in Python.
nclass.hist(x, ...)
x |
a vector of data values. |
... |
additional arguments to be passed to low level functions. |
The value of suggested number of classes/bins.
Luca Scrucca
nclass.FD
,
nclass.Sturges
set.seed(1)
x <- stats::rnorm(111)
nclass.hist(x)
x <- stats::rnorm(1111)
nclass.hist(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.