Learn R Programming

humanleague (version 2.3.1)

integerise: 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)

Value

an integer vector of frequencies that sums to pop.

Arguments

population

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

Examples

Run this code
prob2IntFreq(c(0.1,0.2,0.3,0.4), 11)

Run the code above in your browser using DataLab