The (age) groups of a contact matrix can be joined together by the
grouping
argument, which first sums over contact groups (columns) and
then averages over the corresponding participant groups (rows), optionally
using weights such as the age distribution of the study participants.
aggregateC(C, grouping, ..., weights = NULL)
a square numeric contact matrix such as
contactmatrix_POLYMOD
.
specification of how to aggregate groups.
grouping
can be a named list of vectors of group labels,
or an integer vector of sequential group sizes.
Alternatively, if grouping
is missing, the elements of the list
representation can be passed directly as further arguments (...
).
a named numeric vector containing the weights for the rows of
C
, typically the age distribution of the participants. The names
are matched against rownames(C)
. A value of NULL
is
interpreted as uniform weights.
Sebastian Meyer