A bounded version of rnorm
rnorm_bounded(n, mean = 0, sd = 1, min = -Inf, max = Inf)
number of observations. If length(n) > 1
, the length
is taken to be the number required.
vector of means.
vector of standard deviations.
lower limits of the distribution.
upper limits of the distribution.
Generates values with rnorm, bounded by [min, max]
rnorm_bounded(10)
#> [1] 0.2393847 -0.8829728 0.6940236 -1.1082709 1.2618982 0.2523476
#> [7] 1.4526125 -0.9466355 0.3450136 1.4407874