Translates number vector to bin index, given lower and upper limits of the domain and number of bins. A support function for (smoothing) histograms.
binit(x, xmin = min(x), xmax = max(x), nbin = 100)
A list with components:
a vector of length(x)
with elements giving the bin index.
a vector of length(nbin)
with the midpoints of the bins.
the number of bins.
a numerical vector.
the lower limit of the domain.
the upper limit of the domain.
the number of bins (default=100).
Eilers, P.H.C. and Marx, B.D. (2021). Practical Smoothing, The Joys of P-splines. Cambridge University Press.