Re: [R-sig-eco] Select a percentage of combinations

2019-02-26 Thread Lara Silva
Thank you very much! Regards, Lara Shane Baylis escreveu no dia terça, 26/02/2019 à(s) 01:53: > Hi Lara, > > You want to subset out 20% of the columns from a matrix, at random. Try: > > combinations <- combn(20,3) ## makes the 'all combinations' matrix > sample <-

Re: [R-sig-eco] Select a percentage of combinations

2019-02-25 Thread Shane Baylis
Hi Lara, You want to subset out 20% of the columns from a matrix, at random. Try: combinations <- combn(20,3) ## makes the 'all combinations' matrix sample <- combinations[,sample(1:ncol(combinations), floor(ncol(combinations)*0.2))] ## subsets out 20% of the columns from that object. ## Note

[R-sig-eco] Select a percentage of combinations

2019-02-25 Thread Lara Silva
Hello, I want to select sets of combinations, but I do not want use all 1140 combn (20,3) choose (20,3) - total of 1140. [,1091] [,1092] [,1093] [,1094] [,1095] [,1096] [,1097] [,1098] [,1099] [,1100] [1,] 13 13 13 13 13 13 13 13 13 13 [2,]