vbin: Vector binning

View source: R/seq.R

vbinR Documentation

Vector binning

Description

Bin a vector into 'n' intervals in regard with its value range. The vector x is split into n bins within [min(x), max(x)], and bin index is given by checking the bin [bin_min, bin_max) into which data points in x fall.

Usage

vbin(x, n, center=c(TRUE, FALSE))

Arguments

x

a numeric vector

n

the number of bins

center

indication of representing intervals as index (default) or center points.

Value

Sequence with interval index or center points.

See Also

seq_approximate, vbin.range, vbin.grid

Examples

vbin(1:10, 3)
vbin(1:10, 3, TRUE)

caesar0301/movr documentation built on June 18, 2022, 2:37 a.m.