adj_matrix_from_nei_list: Return adjacency matrix from list of neighbours

Description Usage Arguments Value Author(s) Examples

View source: R/gmrfops.R

Description

Creates a sparse adjacency matrix from list of vertex neighbours.

Usage

1

Arguments

nei_list

a list of vectors, where each vector contains the indices of the adjacent neighbours.

Value

a sparse adjacency matrix (with zero on the diagonal)

Author(s)

Andrew Zammit Mangion

Examples

1
2
nei_list <- list(c(2,3),1,1)
adj.matrix <- adj_matrix_from_nei_list(nei_list)

shazhe/mvst0 documentation built on May 29, 2019, 9:20 p.m.