Learn R Programming

sharp (version 1.4.7)

Square: Adjacency from bipartite

Description

Generates a symmetric adjacency matrix encoding a bipartite graph.

Usage

Square(x)

Value

A symmetric adjacency matrix encoding a bipartite graph.

Arguments

x

matrix encoding the edges between two types of nodes (rows and columns).

Examples

Run this code
# Simulated links between two sets
set.seed(1)
mat <- matrix(sample(c(0, 1), size = 15, replace = TRUE),
  nrow = 5, ncol = 3
)

# Adjacency matrix of a bipartite graph
Square(mat)

Run the code above in your browser using DataLab