Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

adjacencyList2Matrix

Convert adjacency list to an adjacency matrix


Description

Convert adjacency list to an adjacency matrix

Usage

adjacencyList2Matrix(lt, square = FALSE)

Arguments

lt

A data frame which contains adjacency list.

square

Should the returned matrix be a square matrix?

Examples

set.seed(123)
df = data.frame(from = sample(letters, 10, replace = TRUE), 
                to = sample(letters, 10, replace = TRUE), 
                value = 1:10)
adjacencyList2Matrix(df)
adjacencyList2Matrix(df, square = TRUE)

circlize

Circular Visualization

v0.4.12
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2021-1-8

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.