bin.ints: Integer data binning

Description Usage Arguments Details Value See Also Examples

Description

Sometimes with integer data which is not uniformly distributed, a linear color scale is not ideal. The function bin.ints converts an integer vector into a factor vector where each level corresponds to a range of integers and the elements of x are evenly distributed (as much as possible) across the factor levels.

Usage

1
bin.ints(x, num.bins = 10)

Arguments

x

data to be binned

num.bins

number of bins to aim for

Details

This is a convenience function that makesuse of find.bins and label.bins.

Value

bin.ints returns an ordered factor vector with appropriately labeled levels.

See Also

find.bins for determining bin breakpoints

label.bins for bin labels suitable for a legend

Examples

1
2
x <- rpois(100, 10)
x.bin <- bin.ints(x)

sushilashenoy/zoom.plot documentation built on May 30, 2019, 8:42 p.m.