0

Ideally something like f(rowMargins=c(3,10,2),colMargins=c(4,8,3)) that outputs a list of all the 3x3 tables with these margins.

  • 1
    What is your expected out put? May be it is worth looking into https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example in order to improve question – MKR Mar 31 '18 at 13:42

1 Answers1

1

This generates 100,000 such tables randomly and then picks out the unique ones giving in this case 54 such tables.

set.seed(123)
tabs <- unique(r2dtable(100000, c(3,10,2), c(4,8,3)))
length(tabs)
## [1] 54
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341