Skip to content

plotMethods_utils.R

Dion Detterer edited this page Jan 13, 2020 · 1 revision

This function contains only one function: splitMatrix(), used in support of the plot method plot.EpiNet().

splitMatrix()

Summary: This function takes an incidence matrix for a hypergraph and splits it into a list of incidence matrices per order of interaction.

Arguments

  • mm: an incidence matrix

Returns

splitMatrix() returns a list of matrices, one per order of interaction.

Algorithm

  1. Set all elements in mm to 0 or 1
  2. Get a vector of the number of nodes for each column of mm
  3. Reduce the vector to a sorted vector of unique values greater than 1
  4. For each value in the vector
    1. Create a matrix from the columns of mm that contain that many nodes
    2. Store the matrix in a list
  5. Return the list
Clone this wiki locally