R/binwFD.R

Defines functions binwFD

Documented in binwFD

#' Estimate optimal binwidth for histogram according to Freedman-Diaconis rule
#'
#' @param x numeric vector to be plotted on histogram
#'
#' @return numeric vector
#' 
#' @examples
#' x <- rnorm(100)
#' binwFD(x)
#' 
#' @export
#' 
binwFD <- function(x) { 
  2 * IQR(x) / length(x)^(1/3)
}
johngodlee/JLGMisc documentation built on July 17, 2025, 3:09 a.m.