countTables: Count Similarly Margined Contingency Tables

Description Usage Arguments Details Value See Also Examples

View source: R/countTables.r

Description

Count the number of contingency tables with the same marginals as a given table.

Usage

1
2
countTables(table, margins = as.list(1:length(dim(table))), dir = tempdir(),
  opts = "", quiet = TRUE)

Arguments

table

the table of interest

margins

the margins to be fixed

dir

directory to place the files in, without an ending /

opts

options for count

quiet

show latte output

Details

countTables uses LattE's count function (via algstat's count function) to count the tables. In many cases, the number of such tables is enormous. In these cases, instead of giving back an integer countTables provides a character string with the integer in it; see examples.

Value

an integer

See Also

count

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 


data(politics)
countTables(politics)

data(handy)
countTables(handy)

data(HairEyeColor)
eyeHairColor <- margin.table(HairEyeColor, 2:1)
countTables(eyeHairColor)

library(gmp)
as.bigz(countTables(eyeHairColor))


# notice that even tables with small cells can have
# huge fibers
data(drugs)
countTables(drugs)

countTables(eyeHairColor, quiet = FALSE)




## End(Not run)

algstat documentation built on May 29, 2017, 10:34 p.m.

Related to countTables in algstat...