Skip to contents

Provides a helper function for generating weight matrices

Usage

weights_from_vector(membership_vector, sep = ",")

Arguments

membership_vector

vector of strings containing group memberships

sep

separator that delimits group memberships in membership_vector

Value

sparse weight/indicator matrix of type Matrix::dgCMatrix

Examples

a <- c("k,l,m", "k,m", "k", "l", "l,k")
Wa <- weights_from_vector(a)