vendredi 28 février 2020

Random numbers in R (1) with specified mean, sd, (2) within specified range

I would like to generate random numbers with both a specified mean & sd, AND a specified min and/or max (i.e., give me 100 random numbers between 0 and 50 with a mean=20 and sd=10; OR give me 100 random numbers with min=10, mean=25, sd=15).

I can specify mean & sd in runif, rnorm. I can specify a range in sample (though I don't think I can specify ONLY a min or a max)

I need something where I can specify both, in R.

Thanks!




Aucun commentaire:

Enregistrer un commentaire