binit {JOPS}R 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.


[Package JOPS version 0.1.19 Index]