collapse.cases {lca} | R Documentation |
Given an object of class freq.table
, identical cases are identified and
their respective frequencies summed; the simplified table is returned.
An optional second argument allows a secondary table of counts to be collapsed according to the same pattern.
collapse.cases(x, y)
x |
object of class freq.table to be collapsed. |
y |
optional secondary table of counts. |
The function seeks identical cases in x
, then simplifies by
removing the duplication and summing the frequencies.
If an optional second arguement y
is supplied, with number of rows
equal to that of x
, the function collapses it in the same pattern
as x
, summing all columns.
A simplified table of counts.
If y
is supplied, then a list with elements:
x |
simplified version of freq.table x . |
y |
simplified version of y . |
Robin Evans
data(small) small = rbind(small, c(2,2,2,25)) y = matrix(c(12,52,9,29,42,93,49,1,9),9,1) small y # Rows 1 and 9 are identical cases collapse.cases(small, y)