binned: binned

Description Usage Arguments Value Examples

View source: R/binned.R

Description

map vector to bins

Usage

1
binned(x, nbin = 0, type = "width")

Arguments

nbin

the number of bins or an increasing vector giving the bin boundaries

type

c("height", "width") either the same number of elements in a bin or equal widths for the bins

Value

the vector mapped to bin numbers 1 to nbin

Examples

1
2
3
# a<- binned(x, 10) # 10 equal width bins
# a<- binned(x, 0:10) # ten bins for numbers between 0-10
#                     # other numbers that do not fit are in the first or last bin

MrOoijer/myLib documentation built on Dec. 17, 2021, 4:22 a.m.