bin1: univariate binning

Description Usage Arguments Value See Also Examples

View source: R/ash.R

Description

Function to compute array of bin counts for a data vector

Usage

1
bin1(x, ab, nbin=50)

Arguments

x

(input) data vector

ab

(input vector of length 2): half-open interval for bins [a,b). If no value is specified, the range of x is stretched by 5% at each end and used the interval.

nbin

(input integer): number of bins desired. Default 50.

Value

bin1 returns a list including the vector of integer bin counts and the ab vector and the number of points outside the ab interval.

See Also

ash1

Examples

1
2
3
x <- rnorm(100)         # data vector
ab <- c(-5,5)           # bin interval
bins <- bin1(x,ab,10)     # bin x into 10 bins over ab

ash documentation built on May 1, 2019, 6:30 p.m.

Related to bin1 in ash...