chop {ggplot2}R Documentation

Chop

Description

Chop a continuous variable into a categorical variable.

Usage

chop(x, n = 10, width = NULL, method="quantiles", midpoint=0, digits=2, ...)

Arguments

x continuous variable to chop into pieces
n number of bins to chop into
width method to use: quantiles (approximately equal numbers), cut (equal lengths) or pretty
method mid point for diverging factors
midpoint other arguments passed to format
digits
...

Details

Chop provides a convenient interface for discretising a continuous variable. It will break up a continuous variable into chunks with equal numbers of points (method = "quantiles") or equal ranges ( method = "cut"). You can specify the number of bins, with n, or the "width" of each bin, with width

Author(s)

Hadley Wickham <h.wickham@gmail.com>

See Also

round_any, chop.breaks to get breaks used


[Package ggplot2 version 0.8.1 Index]