binning: Dividing a vector of numbers uniformly into bins.

Description Usage Arguments Value Examples

View source: R/binning.R

Description

This function divides v uniformly into nbin and finds the lower bound and upper bound for each bin.

Of limited interest to most users; function binning() would typically be called by some other functions.

Usage

1
binning(v,nbin,range=c(0,1))

Arguments

v

A vector of numbers.

nbin

Number of bins.

range

A vector of two numbers indicating the range of elements in v.

Value

b

A vector with length length(v), giving which bin each element of v belongs to.

s

A vector with length nbin, giving the lower bound defining each bin.

e

A vector with length nbin, giving the upper bound defining each bin.

Examples

1
binning(1:10,2,c(0,10))

lakerwsl/WUNT documentation built on Sept. 13, 2020, 12:15 a.m.