% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute-matrix.R
\name{compute_matrix}
\alias{compute_matrix}
\title{Compute contact matrix from prepared survey data}
\usage{
compute_matrix(survey, counts = FALSE, weight_threshold = NULL)
}
\arguments{
\item{survey}{a \code{\link[=survey]{survey()}} object with age groups assigned (via
\code{\link[=assign_age_groups]{assign_age_groups()}})}

\item{counts}{whether to return counts instead of means}

\item{weight_threshold}{numeric; if provided, weights above this threshold
are capped to the threshold value and then re-normalised (default NULL)}
}
\value{
a list with elements \code{matrix} and \code{participants}
}
\description{
Computes a contact matrix from a \code{contact_survey} that has been processed
by \code{\link[=assign_age_groups]{assign_age_groups()}} and optionally \code{\link[=weigh]{weigh()}}. This is the final step
in the pipeline workflow.

For post-processing, pipe the result into \code{\link[=symmetrise]{symmetrise()}},
\code{\link[=split_matrix]{split_matrix()}}, or \code{\link[=per_capita]{per_capita()}}.
}
\examples{
data(polymod)
polymod |>
  assign_age_groups(age_limits = c(0, 5, 15)) |>
  compute_matrix()

}
