R: Convert adjacency list to adjacency matrix

adjacencyList2Matrix {circlize} | R Documentation

## 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

    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)

[Package circlize version 0.4.5 Index]