I'm trying to find all the possible samples of 3 of this population in Rstudio: 12, 12, 14, 15, 20.
I know by using the combination formula that it will be 10 of them. I want to find all the list using Rstudio. I tried to do it manually but I just get 9 of them:
- 12,12,14
- 12,12,15
- 12,12,20
- 12,14,15
- 12,14,20
- 12,15,20
- 12,14,15
- 12,15,20
- 14,15,20
Will appreciate your help.
When you say "the combination formula", you presumably mean ${5 \choose 3}=10$. This suggests you are treating the two $12$s as completely distinct, as otherwise there might only be seven possibilities.
This is also an issue with some R functions but is not difficult to work round by introducing a distinction and then removing it. For example using
combinations()from thegtoolspackage, you could try something like:to get
and, as Quinlan Uyeda has pointed out, your error was to miss the 8th row