Learn R Programming

socialmixr (version 0.7.0)

check_part_cnt_dims_match: Abort if participant and contact dims of a multi-grouping matrix differ

Description

Internal sanity check for symmetrise() and related operations that require reciprocity. Reciprocity is only defined when each grouping has the same levels on the participant and contact side, which lets us flatten the rank-2K array into a square T x T matrix.

Usage

check_part_cnt_dims_match(matrix, k, op)

Value

invisibly NULL on success; otherwise raises a cli error

Arguments

matrix

the rank-2K contact matrix

k

the number of groupings (length(dim(matrix)) %/% 2L)

op

short label used in the error message