binit: Translated number vector to bin index.

View source: R/binit.R

binitR Documentation

Translated number vector to bin index.

Description

Translates number vector to bin index, given lower and upper limits of the domain and number of bins. A support function for (smoothing) histograms.

Usage

binit(x, xmin = min(x), xmax = max(x), nbin = 100)

Arguments

x

a numerical vector.

xmin

the lower limit of the domain.

xmax

the upper limit of the domain.

nbin

the number of bins (default=100).

Value

A list with components:

xbin

a vector of length(x) with elements giving the bin index.

xgrid

a vector of length(nbin) with the midpoints of the bins.

nbin

the number of bins.

References

Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.


JOPS documentation built on Sept. 8, 2023, 5:42 p.m.

Related to binit in JOPS...