[R] Integer Sample with Mean Dependent on Size

Lorenzo Isella |orenzo@|@e||@ @end|ng |rom gm@||@com
Thu Aug 1 12:27:05 CEST 2019

Dear All,
I cannot unfortunately provide any R code, otherwise I would not need to post this in the first place.
I need to generate a sample of N positive non-zero integers such that their mean is *exactly* 2(N-1)/N, i.e. the mean depends on the length of the sample.
For a start, we can assume that every integer in my sample can assume only the values 1, 2 and 3.
Any suggestion is appreciated.


More information about the R-help mailing list