edge2vertices: Translate between index and vertex edge references

Description Usage Arguments Details Value

View source: R/edge2vertices.R

Description

Vertices refer to the [source, target] ordered pair defining a directed edge. Indices refer to a 1-D index into the graph representation. The functions edge2vertices and vertices2edge translate between these representations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
edge2vertices(x, ...)

## S3 method for class 'matrix'
edge2vertices(x, indices)

## S3 method for class 'igraph'
edge2vertices(g, indices)

vertices2edge(x, ...)

## S3 method for class 'matrix'
vertices2edge(x, vertices)

## S3 method for class 'igraph'
vertices2edge(g, vertices)

Arguments

x

An adjacency matrix

indices

A numeric vector; 1-D index referencing edges in the graph.

g

An igraph object

vertices

A matrix specifying edges as source->target ordered pairs.

Details

Adjacency matrices are assumed to be oriented such that the row indicates the source vertex and the column indicates that target vertex.

The returned matrix of vertices will be oriented such that each column is an edge. The first row contains the source vertices, and the second row contains the target vertices.

Value

A matrix of vertex pairs representing edges. Each column is an edge, and the first row is the source vertex.


crcox/latticize documentation built on Dec. 19, 2021, 6:19 p.m.