Description Usage Arguments Value Examples
This function allows you to generate your desired number of random numbers from your chosen distribution.
1 2 | random_number(num, distribution, mu = NULL, sigma = NULL,
trials = NULL, p = NULL, l = NULL)
|
num |
Number of required output |
distribution |
Distribution of output. Should be one of "normal", "binomial", "poisson" |
mu |
Required for NORMAL distribution only - distribution mean |
sigma |
Required for NORMAL distribution - distribution standard deviation |
trials |
required for BINOMIAL distribution - number of yes/no trials in the test |
p |
required for BINOMIAL distribution - probability of success (i.e. 'yes' outcome) |
l |
required for POISSON distribution - lambda is the rate perameter (i.e. events per interval of time) |
random numbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | x_n <- random_number(num = 5, distribution = "normal",
mu = 0, sigma = 1,
trials = NULL, p = NULL,
l = NULL)
x_b <- random_number(num = 5, distribution = "binomial",
mu = NULL, sigma = NULL,
trials = 10, p = 0.5,
l = NULL)
x_p <- random_number(num = 20, distribution = "poisson",
mu = NULL, sigma = NULL,
trials = NULL, p = NULL,
l = 5)
summary(x_n)
summary(x_b)
summary(x_p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.