Generates a set of Poisson distributed values.

r_pois(rate, ..., n = default_n(rate), .seed = NULL)

Arguments

rate

vector of rates, strictly positive

...

Unused

n

number of observations to generate. The default_n() function will provide a default value within context

.seed

One of the following:

  • NULL (default) will not change the current seed. This is the usual case for generating random numbers.

  • A numeric value. This will be used to set the seed before generating the random numbers. This seed will be stored with the results.

  • TRUE. A random seed value will be generated and set as the seed before the results are generated. Again, this will be stored with the results.

To extract the random seed from a previously generated set of values, use pull_seed()

Value

A numeric vector of length n

Examples

set_n(5) r_pois(10)
#> [1] 7 9 12 9 5
r_pois(1:10)
#> [1] 0 2 3 6 8 10 8 10 5 8
r_pois(10, n = 10)
#> [1] 11 13 8 8 14 7 6 11 4 12