Does anybody know a function custom or not, to generate random integers following (as a whole set) a predefined mean and standard deviation?
For example I'd like to be able to generate a set of 5 integer that will have a mean of 2.8 and standard deviation of 2.4 and consist of values from a 0 to 6 range:
function(N=5, M=2.8, SD=2.4, range=0:6)
> 0 1 3 6 4
I found posts that relate to random integers summing to a given value: Generate N random integers that sum to M in R but I couldn't figure out how to reuse it for my case scenario