Description Usage Arguments Value Examples
View source: R/utilities_math.R
rnorm_bounded
generates random numbers from a normal distribution
using rnorm(), but forced to remain within the specified low/high bounds. All
proposals outside the boundaries (exclusive) are discarded, and the sampling
is repeated until there are enough values within the specified range. Fully
vectorized.
1 2 |
n |
the number of values to return |
mean |
the mean of the normal distribution from which values are generated (vector of length 1 or n) |
sd |
the standard deviation of the normal distribution from which values are generated (vector of length 1 or n) |
low, high |
exclusive lower and upper bounds ((vectors of length 1 or n)) |
roundToInteger |
boolean vector of length 1 or n. If TRUE, the corresponding value is rounded to the nearest integer. |
A vector of length n.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.