Generates a set of Beta distributed values.

r_beta(alpha, beta, ..., n = default_n(alpha, beta), .seed = NULL)

Arguments

alpha, beta

vectors of shape parameters, 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_beta(1, 1)
#> [1] 0.1434250 0.4476224 0.3125523 0.9553828 0.9293188
r_beta(1:10, 2)
#> [1] 0.2408084 0.8363304 0.5393095 0.5393641 0.5758497 0.7696084 0.7475831 #> [8] 0.8135505 0.7239247 0.8946778
r_beta(1, 2, n = 10)
#> [1] 0.07145782 0.39068790 0.19917322 0.48011231 0.20171690 0.07750948 #> [7] 0.07942122 0.34698020 0.18583927 0.02415742