A function to generate a two-way table with independent margins
genIndepTable(n = sample(100:500, size = 1), prow = 1:3, pcol = 1:4,
dmnames = list(X = paste("x", 1:length(prow), sep = ""),
Y = paste("y", 1:length(pcol), sep = "")), addmargins = TRUE,
as.df = FALSE, untable = TRUE)
sum total of observations generated
nonnegative weights for the row marginal distribution
nonnegative weights for the col marginal distribution
names for the table dimensions
should margins be added to the table
should the result be returned as a data frame
if true then data frame will be expanded to one observation per row
Either an object of class table or a data frame.
This function will generate a two-way table with independent marginal distributions.