Skip to contents

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)