project_to_one_mode function

Create a one-mode projection of a two mode graph

Create a one-mode projection of a two mode graph

Create a one-mode projection of a two mode graph. Converts a rectangular matrix to a square one by taking the cross product of the input matrix. The edge weights in the resulting matrix are equal to the number of transitive ties of each node in the input matrix.

project_to_one_mode(adj_mat, mode = c("rows", "columns"))

Arguments

  • adj_mat: Sparse matrix of class dgCMatrix
  • mode: Mode to return. Defaults to projecting by rows.

Returns

A double or complex matrix, with appropriate dimnames taken from x and y.

Examples

#make matrix my_matrix <- sparseMatrix(i = c(1, 1, 2, 3, 4, 4, 5, 6, 7, 7), j = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), x = 1 ) #project to one mode project_to_one_mode(adj_mat = my_matrix, mode = "rows")
  • Maintainer: Brian Aronson
  • License: MIT + file LICENSE
  • Last published: 2020-03-23

Useful links