View source: R/weights_from_vector.R
interaction_weights | R Documentation |
Provides a helper function for pre-generating interactions. Takes sparse weight/indicator matrices generated with e.g. Matrix::fac2sparse() or weights_from_vector() as input.
interaction_weights(a, b)
a |
sparse weight/indicator matrix of class Matrix::dgCMatrix |
b |
sparse weight/indicator matrix of class Matrix::dgCMatrix |
sparse interaction weight/indicator matrix of class Matrix::dgCMatrix
a <- rep(c("k", "l", "l,k"), 2)
b <- rep(c("m", "n"), 3)
Wa <- weights_from_vector(a)
Wb <- Matrix::fac2sparse(b)
Wab <- interaction_weights(Wa, Wb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.