binCounts {SiMRiv} | R Documentation |
Count values in given bins
Description
A convenience function to count the values (optionally log-transformed) falling within given equal-range bins.
Usage
binCounts(data, range, nbins, log = FALSE)
Arguments
data |
a numeric vector with the data. |
range |
the closed data range in which to divide bins, as a two-element numeric vector. Values falling outside |
nbins |
the number of bins to split the data. Result is guaranteed to have this number of bins, irrespective of data. |
log |
whether or not to log-transform data and ranges before binning. |
Details
This is just a convenience function to simplify the task of couting data in equal bins.
The same result could be achieved with hist
with the right arguments.
It is mostly used internally by adjustModel
during the approximation on input parameters,
for the computation of objectives.
Value
A named vector with the counts of values in each bin.