rdist | R Documentation |
Draw n samples from uniform, normal, truncated normal (-> positive only), lognormal or gamma distributions based on two input values
rdist(dist_name, value_1, value_2, n, shift = 0, seed = NULL)
dist_name |
Character vector specifying the Name of the distribution. Either "none", "uniform", "normal" "tnormal" (for truncated), "lognormal", "gamma", "derived", "tderived" or "logderived" |
value_1, value_2 |
Distribution parameters based on dist_name: |
n |
Number of samples to be drawn |
shift |
An numeric value defining a subsequent shift of the distribution The default is 0 (-> no shift) |
seed |
A numeric value to set the seed for random selection. The default is NULL -> no seed |
The values specified in value_1 and value_2 represent min and max for "uniform", mean and standard deviation for "normal" and "tnormal", log mean and log standard deviation (both natural logarithm) for "lognormal", shape and rate for"gamma". The shift value is especially interesting for lognormal or gamma distributions.
Numeric vector of length n with randomly drawn samples of the specified distribution
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.