runif_rs | R Documentation |
Generate random numbers from a uniform distribution, with user-specified population mean and standard deviation.
runif_rs(n = 10, min = 0, max = 1, pmean = 0, psd = 1)
n |
The number of random numbers to generate. |
min |
min for runif. |
max |
max for runif. |
pmean |
Population mean. |
psd |
Population standard deviation. |
First, the user specifies the parameters, min and max, and the desired population mean and standard deviation. Then the random numbers will be generated and rescaled with the desired population mean and standard.
A vector of the generated random numbers.
set.seed(90870962)
x <- runif_rs(n = 5000,
min = 2,
max = 4,
pmean = 3,
psd = 1)
mean(x)
sd(x)
hist(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.