R/histDens.R

Defines functions histDens

Documented in histDens

histDens <- function( x, breaks = "Sturges", ... ) {
  h <- hist( x, breaks = breaks, plot = FALSE )
  d <- density( x )
  hist( x, breaks = breaks, prob = TRUE,
    ylim = c( 0, max( c( h$density, d$y ) ) ), ... )
  lines( d, lwd = 2 )
  invisible( NULL )
}

Try the miscTools package in your browser

Any scripts or data that you put into this service are public.

miscTools documentation built on May 3, 2023, 5:11 p.m.