histf: Fancy Histogram

Description Usage Arguments Examples

View source: R/basic.R

Description

Fancy Histogram

Usage

1
2
3
4
histf(x, breaks = sqrt(length(x)), length.out = 100, rug = FALSE,
  boxplot = FALSE, fill = "lightblue", main = paste("Histogram of",
  xname), densityFunction = function(y) dnorm(y, mean(x), sd(x)),
  densityName = "normal", xrange = extendrange(c(min(x), max(x))), ...)

Arguments

x

a numeric vector

breaks

see hist

Examples

1
2
3
4
5
6
7
with(subset(hweight, gender=="M"), histf(height))
with(subset(hweight, gender=="M"), {
   hist(height, probability=TRUE, breaks=sqrt(length(height)), col="lightblue")
   lines(density(height))
   xs <- seq(min(height), max(height), length.out=100)
   lines(xs, dnorm(xs))
})

regbook/regbook documentation built on June 27, 2020, 10:15 p.m.