binCounts: Count values in given bins

View source: R/estimation.r

binCountsR 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 range are discarded.

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.

See Also

adjustModel.


SiMRiv documentation built on Sept. 15, 2023, 5:07 p.m.