Learn R Programming

SIMplyBee (version 0.4.1)

nFathersPoisson: Sample a number of fathers

Description

Sample a number of fathers - use when nFathers = NULL (see SimParamBee$nFathers).

This is just an example. You can provide your own functions that satisfy your needs!

Usage

nFathersPoisson(n = 1, average = 15)

nFathersTruncPoisson(n = 1, average = 15, lowerLimit = 0)

Value

numeric, number of fathers

Arguments

n

integer, number of samples

average

numeric, average number of fathers

lowerLimit

numeric, returned numbers will be above this value

Functions

  • nFathersTruncPoisson(): Sample a non-zero number of fathers

Details

nFathersPoisson samples from a Poisson distribution, which can return a value 0 (that would mean a failed queen mating).

nFathersTruncPoisson samples from a truncated Poisson distribution (truncated at zero) to avoid failed matings.

See Also

SimParamBee field nFathers

Examples

Run this code
nFathersPoisson()
nFathersPoisson()
n <- nFathersPoisson(n = 1000)
hist(n, breaks = seq(from = min(n), to = max(n)), xlim = c(0, 40))
table(n)

nFathersTruncPoisson()
nFathersTruncPoisson()
n <- nFathersTruncPoisson(n = 1000)
hist(n, breaks = seq(from = min(n), to = max(n)), xlim = c(0, 40))
table(n)

Run the code above in your browser using DataLab