chop: Chop a continuous variable into a categorical variable.

View source: R/aesthetic-maps.r

chopR Documentation

Chop a continuous variable into a categorical variable.

Description

Chop provides a convenient interface to the main methods of converting a continuous variable into a categorical variable.

Usage

chop(x, n = 5, method = "quantiles", midpoint = 0, digits = 2)

Arguments

x

continuous variable to chop into pieces

n

number of bins to chop into

method

method to use: quantiles (approximately equal numbers), cut (equal lengths) or pretty

midpoint

mid point for diverging factors

digits

number of digits to show in labels


hadley/ggplot1 documentation built on Dec. 1, 2024, 11:23 a.m.