Learn R Programming

circlize (version 0.4.1)

adjacencyList2Matrix: Convert adjacency list to adjacency matrix

Description

Convert adjacency list to adjacency matrix

Usage

adjacencyList2Matrix(lt, square = FALSE)

Arguments

lt

a data frame which contains adjacency list.

square

is the returned matrix a square matrix?

Details

Convert adjacency list to adjacency matrix.

Examples

Run this code
# NOT RUN {
lt = data.frame(letters[1:5], letters[6:10])
adjacencyList2Matrix(lt)

lt = data.frame(letters[1:5], letters[6:10], 1:5)
adjacencyList2Matrix(lt)

set.seed(123)
lt = data.frame(sample(letters, 4), sample(letters, 4), 1:4)
adjacencyList2Matrix(lt)
adjacencyList2Matrix(lt, square = TRUE)

# }

Run the code above in your browser using DataLab