graph-coerce | R Documentation |
Methods for changing graph representations
coerceGraph(object, class)
graph_as(object, outtype, intype = NULL)
object |
A graph object |
class |
The desired output class |
outtype |
The desired output outtype |
intype |
The desired output outtype (only relevant if object is a list) |
coerceGraph is used in the book "Graphical models with R". A more generic approach is as().
g1 <- ug(~a:b+b:c)
as(g1, "igraph")
as(g1, "matrix")
as(g1, "Matrix")
as(g1, "dgCMatrix")
## graph_as(g1, "ugList") ## Fails
## getCliques(g1) ## Works
l1 <- list(c("a" ,"b"), c("b", "c"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.