matrix_projection: Unipartite projections

View source: R/utilities.R

matrix_projectionR Documentation

Unipartite projections

Description

Two-mode networks can be represented (or 'projected') as one-mode networks.

Usage

matrix_projection(A, B = NULL, digraph = FALSE)

Arguments

A

A first matrix object

B

A second matrix object

digraph

Whether the matrix is directed or not

Value

This function return a list of matrices of the two projections of the original matrix.

Author(s)

Alejandro Espinosa-Rada

References

Davis, Allison; Gardner, Burleigh B. and Mary. R. Gardner (1941). Deep South: A Social Anthropological Study of Caste and Class. The University of Chicago Press, Chicago.

Breiger, Ronald L. (1976). The Duality of Persons and Groups, 53(2), 181-190 doi: https://doi.org/10.2307/2576011

Wasserman, S. and Faust, K. (1994). Social network analysis: Methods and applications. Cambridge University Press.

Examples

A <- matrix(c(
  2, 0, 2,
  1, 1, 0,
  0, 3, 3,
  0, 2, 2,
  0, 0, 1
), byrow = TRUE, ncol = 3)
matrix_projection(A)

A <- matrix(c(
  0, 0, 0, 0, 1,
  1, 0, 0, 0, 0,
  1, 1, 0, 0, 0,
  0, 1, 1, 1, 1,
  0, 0, 1, 0, 0,
  0, 0, 1, 1, 0
), byrow = TRUE, ncol = 5)

B <- matrix(c(
  0, 0, 0, 0, 1,
  1, 0, 0, 0, 0,
  1, 0, 0, 0, 0,
  0, 1, 0, 0, 0,
  0, 0, 1, 0, 0,
  0, 0, 1, 0, 0
), byrow = TRUE, ncol = 5)
matrix_projection(A, B, digraph = TRUE)

anespinosa/netmem documentation built on April 5, 2025, 5:02 p.m.