ctabs.RdEfficient weighted cross tabulation of two factors and a block
a integer of positive values with zero indicating a missing.
an optional integer of positive values with zero indicating a missing.
an optional blocking factor without missings.
an optional vector of case weights, integer or double.
an optional integer vector indicating a subset.
a logical for switching off missing value checks.
A faster version of xtabs(weights ~ ix + iy + block, subset).
If block is present, a three-way table. Otherwise,
a one- or two-dimensional table.
ctabs(ix = 1:5, iy = 1:5, weights = 1:5 / 5)
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0 0.0 0.0 0.0 0.0 0
#> [2,] 0 0.2 0.0 0.0 0.0 0
#> [3,] 0 0.0 0.4 0.0 0.0 0
#> [4,] 0 0.0 0.0 0.6 0.0 0
#> [5,] 0 0.0 0.0 0.0 0.8 0
#> [6,] 0 0.0 0.0 0.0 0.0 1