Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

graph-edgeList

Find edges in a graph and edges not in a graph.


Description

Returns the edges of a graph (or edges not in a graph) where the graph can be either a 'graphNEL' object, an 'igraph' object or an adjacency matrix.

Usage

edgeList(object, matrix = FALSE)

edgeListMAT(adjmat, matrix = FALSE)

nonEdgeList(object, matrix = FALSE)

nonEdgeListMAT(adjmat, matrix = FALSE)

Arguments

object

A 'graphNEL' object, an 'igraph' object, a dense matrix or a sparse 'dgCMatrix' (the two latter representing an adjacency matrix).

matrix

If TRUE the result is a matrix; otherwise the result is a list.

adjmat

An adjacency matrix.

Examples

## A graph with edges
g  <- ug(~a:b + b:c + c:d)
gm <- as(g, "matrix")
edgeList(g)
edgeList(gm)
edgeListMAT(gm)
edgeList(g, matrix=TRUE)
edgeList(gm, matrix=TRUE)
edgeListMAT(gm, matrix=TRUE)
nonEdgeList(g)
nonEdgeList(gm)
nonEdgeListMAT(gm)
## A graph without edges
g  <- ug(~a + b + c)
gm <- as(g, "matrix")
edgeList(g)
edgeList(gm)
edgeListMAT(gm)
edgeList(g, matrix=TRUE)
edgeList(gm, matrix=TRUE)
edgeListMAT(gm, matrix=TRUE)
nonEdgeList(g)
nonEdgeList(gm)
nonEdgeListMAT(gm)

gRbase

A Package for Graphical Modelling in R

v1.8-6.7
GPL (>= 2)
Authors
Søren Højsgaard <sorenh@math.aau.dk>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.