ra_sample | R Documentation |
This function samples random values from probability distributions. The function, conveniently, wraps other functions to provide multiple distributions under a single function. Some of the distributions currently supported includes: normal, poisson, triangular, uniform, gamma, inverse gamma, log normal, pert.
ra_sample(x, n, full = F)
x |
Distribution specification, must specify the name of the distribution and parameters, e.g. Normal (10, 0.4) .Current distributions supported include: uniform, binomial, triangle, poisson, normal and pert. If no distribution specified. the value will be assumed to be fixed. |
n |
Number of observations to be sampled from the distribution |
full |
TRUE/FALSE. If TRUE a list with the samples, and distribution specified will be returned, Only a vector of the observations will be returned otherwise. |
A numeric vector containing values sampled from the distribution specified.
ra_sample(x = 'pert(0.01, 0.03, 0.64)', n = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.