powered by
Get the graph-class part or “aspect” of an R object, notably from our pc(), skeleton(), fci(), etc, results.
graph-class
pc()
skeleton()
fci()
getGraph(x)
a graph-class object, i.e., one inheriting from (the virtual) class "graph", package graph.
"graph"
potentially any R object which can be interpreted as a graph (with nodes and edges).
signature(x = "ANY")
the default method just tries as(x, "graph"), so works when a coerce (S4) method is defined for x.
as(x, "graph")
coerce
x
signature(x = "pcAlgo")
and
signature(x = "fciAlgo")
extract the graph part explicitly.
signature(x = "matrix")
interpret x as adjacency matrix and return the corresponding "graphAM" object.
"graphAM"
For sparseMatrix methods, see the ‘Note’.
Martin Maechler
fci, etc. The graph-class class description in package graph.
fci
A <- rbind(c(0,1,0,0,1), c(0,0,0,1,1), c(1,0,0,1,0), c(1,0,0,0,1), c(0,0,0,1,0)) sum(A) # 9 getGraph(A) ## a graph with 5 nodes and 'sum(A)' edges
Run the code above in your browser using DataLab