hist: Histograms

Description Usage Arguments Value Examples

Description

Front-end to hist allowing a formula interface alternative

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
hist(x, ...)

## S4 method for signature 'numeric'
hist(
  x,
  ...,
  border = colour,
  colour = color,
  color = NULL,
  col = fill,
  fill = NULL,
  main,
  xlab
)

## S4 method for signature 'formula'
hist(x, data = parent.frame(2), ..., main, xlab)

Arguments

x

either a numerical vector or a one-sided formula specifying the response variable

...

additional arguments sent to graphics::hist

border, colour, color

alternative argument names for the border

col, fill

alternative argument names for the fill colour; may be a colout palette function

main, xlab

as for graphics::hist

data

a data frame or environment

Value

as for graphics::hist

Examples

1
2
3
4
hist(~log10(crim), MASS::Boston, binWidth(0.125, align = 0),
     fill = pal_sea2sand, colour = "grey", lwd = 0.5, prob = TRUE)
rug(~log10(crim), MASS::Boston, col = "hot pink")
with(MASS::Boston, lines(density(log10(crim)), col="brown"))

BillVenables/WWRGraphics documentation built on Feb. 1, 2021, 12:13 p.m.