Generates a set of Gamma distributed values. Can be defined by
one and only one of scale
, rate
or mean.
This must be named in the call.
r_gamma( shape, ..., scale = 1, rate = NULL, mean = NULL, n = default_n(shape, scale, rate, mean), .seed = NULL )
shape | vector of shape parameters, strictly positive |
---|---|
... | Unused |
scale | vector of scale parameters, cannot be specified with |
rate | vector of rate parameters, cannot be specified with |
mean | vector of mean parameters, cannot be specified with |
n | number of observations to generate. The |
.seed | One of the following:
To extract the random seed from a previously generated set of
values, use |
A numeric vector of length n
#> [1] 8.434057 11.003641 12.792271 7.427495 8.305949r_gamma(1:10, scale = 2)#> [1] 3.0285958 0.7675734 1.2381984 8.0872663 10.4559315 12.3761452 #> [7] 15.2772578 14.3447510 24.5743689 17.4492357r_gamma(1:10, rate = 1 / 2)#> [1] 0.833834 4.805072 6.146688 13.619971 9.308173 23.234792 6.562422 #> [8] 11.671311 19.165666 23.249137r_gamma(1:10, mean = 5)#> [1] 7.6037200 0.1380241 4.8613137 8.2837324 4.1632452 2.6330293 4.6930505 #> [8] 3.5650226 4.3502901 4.1910517r_gamma(10, n = 10)#> [1] 5.691963 11.585059 10.892211 9.797823 10.539044 13.617776 6.439757 #> [8] 9.057051 5.467761 14.489713