matrix_to_vec: Convert matrix to vector.

View source: R/extra_functions.R

matrix_to_vecR Documentation

Convert matrix to vector.

Description

The function encodes an adjacency matrix into a vector.

Usage

matrix_to_vec(A, type = c("undirected", "directed"))

Arguments

A

Adjacency matrix of a network.

type

Parameter to specify whether the adjacency matrix represents an undirected or directed network. Default is undirected.

Value

A vector containing the upper triangular part of an adjacency matrix (if the graph is undirected) or adjacency entry values ordered by column and excluding the diagonal entries (if the graph is directed).


jesusdaniel/graphclass documentation built on Aug. 10, 2022, 3:10 p.m.