I have a vector including 9 observations and set to 3 treatments. I need to do the systematic permutation,not 9!. It is 9!/(2!3!4!)=1260. first 9 choose 2,then 7 choose 3, rest obs will in treatment 3. I have already write the code for 2 parts,but I can not figure out how to list all the possible outcomes. Since there are some observations are replicate. the permutation are not quite right. I need to assign the Id for each observation first. I have some problem about how to assign the id and permute id first, then return the real observations. list is my R code.there are some mistakes. I need a help to complete this program. Thank you!
for (k in 1260) {
allperm<-c(A,B,C)
A <- combn(complete, 2)
for (i in 1:36){
complete_B <- complete[!(complete %in% A[,i])]
B <- combn(complete_B, 3)
for (j in 1:35){
C <- complete_B[!(complete_B %in% c(B[,j], A[,i]))]
}
}
}