Skip to contents

Get a graph object out of an MultiFactor.

Usage

# S4 method for class 'MultiFactor'
getGraph(x, format = "igraph", ...)

# S4 method for class 'list'
getGraph(x, format = "igraph", ...)

Arguments

x

MultiFactor

format

Character scalar, controls output format by package name. "igraph" and "graph" are supported.

...

additional arguments (currently not used).

Value

a specified graph object.

See also

igraph::graph_from_data_frame() and igraph::as_graphnel(), which are used under the hood, from igraph::igraph() package.

Examples

# Generate a regular igraph object
g <- getGraph(kegg_link())
plot(g)



# Output formats
ec2cpd <- kegg_link()[["ec2cpd"]]

getGraph(ec2cpd, format = "graph")
#> A graphNEL graph with undirected edges
#> Number of Nodes = 2 
#> Number of Edges = 1 
getGraph(ec2cpd, format = "igraph")
#> IGRAPH aa71570 UN-- 2 1 -- 
#> + attr: name (v/c)
#> + edge from aa71570 (vertex names):
#> [1] ec--cpd