我想为我的教室创建一个清单,列出每组4名学生的可能。如果我有20个学生,我该如何在R中按组创建该对象,其中我的行是每个组合,并且学生ID的完整列表有20列,第1-4列是“ group1”,第5-9列是“ group2”等。
下面列出了每组4个学生(x1,x2,x3和x4)的可能组合。现在,对于列出的每一行,其他4组4个学生的可能性是什么?因此,应该有20列(Group1_1:4,Group2_1:4,Group3_1:4,Group4_1:4,Group5_1:4)。
combn(c(1:20), m = 4)
Run Code Online (Sandbox Code Playgroud)
期望的输出
Combination 1 = Group1[1, 2, 3, 4] Group2[5, 6, 7, 8], Group3[9, 10, 11, 12], etc.
Combination 2 = Group1[1, 2, 3, 5]... etc.
Run Code Online (Sandbox Code Playgroud)
那里有很多关于组合的帖子,可能这已经被回答了,我只是找不到。任何帮助表示赞赏!
I have a custom shiny input which is a balanced set of sliders. I am trying to use the updateBalancedSliderInput so I can reset the values to their defaults. However, in my app, this updateBalancedSlider function does not kick off any reactives in order to update the outputs. Javascript and shiny example below. My assumption is I just need something in my js file to kick off the reactives on the server side. The UI updates just fine when trying …