graph-edgeList.Rd
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.
edgeList(object, matrix = FALSE)
edgeListMAT(adjmat, matrix = FALSE)
nonEdgeList(object, matrix = FALSE)
nonEdgeListMAT(adjmat, matrix = FALSE)
## A graph with edges
g <- ug(~a:b + b:c + c:d)
gm <- as(g, "matrix")
edgeList(g)
#> [[1]]
#> [1] "a" "b"
#>
#> [[2]]
#> [1] "b" "c"
#>
#> [[3]]
#> [1] "c" "d"
#>
edgeList(gm)
#> [[1]]
#> [1] "a" "b"
#>
#> [[2]]
#> [1] "b" "c"
#>
#> [[3]]
#> [1] "c" "d"
#>
edgeListMAT(gm)
#> [[1]]
#> [1] "a" "b"
#>
#> [[2]]
#> [1] "b" "c"
#>
#> [[3]]
#> [1] "c" "d"
#>
edgeList(g, matrix=TRUE)
#> [,1] [,2]
#> [1,] "a" "b"
#> [2,] "b" "c"
#> [3,] "c" "d"
edgeList(gm, matrix=TRUE)
#> [,1] [,2]
#> [1,] "a" "b"
#> [2,] "b" "c"
#> [3,] "c" "d"
edgeListMAT(gm, matrix=TRUE)
#> [,1] [,2]
#> [1,] "a" "b"
#> [2,] "b" "c"
#> [3,] "c" "d"
nonEdgeList(g)
#> [[1]]
#> [1] "a" "c"
#>
#> [[2]]
#> [1] "a" "d"
#>
#> [[3]]
#> [1] "b" "d"
#>
nonEdgeList(gm)
#> [[1]]
#> [1] "a" "c"
#>
#> [[2]]
#> [1] "a" "d"
#>
#> [[3]]
#> [1] "b" "d"
#>
nonEdgeListMAT(gm)
#> [[1]]
#> [1] "a" "c"
#>
#> [[2]]
#> [1] "a" "d"
#>
#> [[3]]
#> [1] "b" "d"
#>
## A graph without edges
g <- ug(~a + b + c)
gm <- as(g, "matrix")
edgeList(g)
#> list()
edgeList(gm)
#> list()
edgeListMAT(gm)
#> list()
edgeList(g, matrix=TRUE)
#> [,1] [,2]
edgeList(gm, matrix=TRUE)
#> [,1] [,2]
edgeListMAT(gm, matrix=TRUE)
#> [,1] [,2]
nonEdgeList(g)
#> [[1]]
#> [1] "a" "b"
#>
#> [[2]]
#> [1] "a" "c"
#>
#> [[3]]
#> [1] "b" "c"
#>
nonEdgeList(gm)
#> [[1]]
#> [1] "a" "b"
#>
#> [[2]]
#> [1] "a" "c"
#>
#> [[3]]
#> [1] "b" "c"
#>
nonEdgeListMAT(gm)
#> [[1]]
#> [1] "a" "b"
#>
#> [[2]]
#> [1] "a" "c"
#>
#> [[3]]
#> [1] "b" "c"
#>