optimal_bins: Determine optimal number of bins using Scott's Rule

View source: R/optimal_bins.R

optimal_binsR Documentation

Determine optimal number of bins using Scott's Rule

Description

Calculates the optimal number of bins for a numeric vector based on Scott's rule.

Usage

optimal_bins(x)

Arguments

x

Numeric vector.

Value

Integer representing the optimal number of bins.

Examples

# Simple example
# Example with normally distributed data
optimal_bins(rnorm(100))

commecometrics documentation built on Aug. 8, 2025, 6:10 p.m.