weights_from_columns: Weight matrix from columns containing memberships

View source: R/weights_from_vector.R

weights_from_columnsR Documentation

Weight matrix from columns containing memberships

Description

Provides a helper function for generating weight matrices

Usage

weights_from_columns(membership_columns)

Arguments

membership_columns

columns containing group memberships

Value

sparse weight/indicator matrix of type Matrix::dgCMatrix

Examples

a <- cbind(
  c("k", "k", "l", NA, "m"),
  c("l", "m", "k", "m", "k"),
  c("m", NA, "m", NA, NA)
)
Wa <- weights_from_columns(a)

jvparidon/lmerMultiMember documentation built on Oct. 22, 2023, 3:42 p.m.