to_matrix: Convert edge data frame to adjacency matrix

View source: R/converters.R

to_matrixR Documentation

Convert edge data frame to adjacency matrix

Description

Convert edge data frame to adjacency matrix

Usage

to_matrix(edges, symmetric = TRUE)

Arguments

edges

A data frame with from, to, weight columns.

symmetric

Logical. If TRUE (default), produces a symmetric matrix.

Value

A sparse Matrix.

Examples

data(biblio_data)
edges <- reference_network(biblio_data, min_occur = 2)
to_matrix(edges)

bibnets documentation built on June 19, 2026, 1:06 a.m.