powered by
This function will generate the closest integer vector to the probabilities scaled to the population.
prob2IntFreq(pIn, pop)
a numeric vector of state occupation probabilities. Must sum to unity (to within double precision epsilon)
the total population
an integer vector of frequencies that sums to pop.
# NOT RUN { prob2IntFreq(c(0.1,0.2,0.3,0.4), 11) # }
Run the code above in your browser using DataLab