Description Usage Arguments Value References Examples
Compute the Number of Classes for a Histogram
1 |
x |
a data vector. |
The suggested number of classes.
Scott, D. W. (1979). On optimal and data-based histograms. Biometrika, 66, 605–610. doi: 10.2307/2335182.
1 2 3 4 5 6 7 8 | x <- rnorm(1000)
hist(x, breaks = nclass.scott)
hist(x, breaks = nclass.scottRob)
x2 <- c(x, rnorm(50, mean = 50))
hist(x2, breaks = nclass.scott)
hist(x2, breaks = nclass.scott, xlim = c(-5, 5))
hist(x2, breaks = nclass.scottRob, xlim = c(-5, 5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.