integerise: Generate integer population from a fractional one where the...

View source: R/RcppExports.R

integeriseR Documentation

Generate integer population from a fractional one where the 1-d partial sums along each axis have an integral total

Description

This function will generate the closest integer array to the fractional population provided, preserving the sums in every dimension.

Usage

integerise(population)

Arguments

population

a numeric vector of state occupation probabilities. Must sum to unity (to within double precision epsilon)

Value

an integer vector of frequencies that sums to pop.

Examples

prob2IntFreq(c(0.1,0.2,0.3,0.4), 11)

humanleague documentation built on April 18, 2023, 1:09 a.m.