optimal_bins | R Documentation |
Calculates the optimal number of bins for a numeric vector based on Scott's rule.
optimal_bins(x)
x |
Numeric vector. |
Integer representing the optimal number of bins.
# Simple example
# Example with normally distributed data
optimal_bins(rnorm(100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.