binNumber: Bin numbers for histograms

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Generates a function to be used as the breaks= argument of hist, to ensure that a fixed number of bins will be used, precisely. In this case specifying a nice alignment is not available.

Usage

1

Arguments

n

The required precise number of bins to be used, unaligned.

...

extra arguments, currently unused

Value

a breaks function to be used by hist

Examples

1
2
3
4
hist(~medv/rm, MASS::Boston, binNumber(25), fill = pal_green2brown)
with(MASS::Boston, rug((medv/rm), col = "red"))
hist(~log10(medv/rm), MASS::Boston, binNumber(25), fill = pal_green2brown)
with(MASS::Boston, rug(log10(medv/rm), col = "red"))

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