from_graph6 {rgraph6}R Documentation

Functions parsing 'graph6' symbols

Description

These functions take a vector of 'graph6' symbols and return a list of other types of objects:

Usage

adjacency_from_graph6(g6)

igraph_from_graph6(g6, ...)

network_from_graph6(g6, ...)

Arguments

g6

character vector of 'graph6' symbols

...

other arguments, see Details.

Details

For igraph_from_graph6() additional arguments are passed to igraph::graph_from_adjacency_matrix()

For network_from_graph6() additional arguments are passed to network::as.network()

Value

The returned object is:

See Also

as_graph6() for saving objects as 'graph6' symbols.

Examples

A <- matrix(c(0,1,0,1,
              1,0,1,0,
              0,1,0,1,
              1,0,1,0), 4, 4, byrow = TRUE)
g6 <- as_graph6(A)

# To adjacency matrix ------------------------------------------------------
adjacency_from_graph6(g6)

# To igraph objects --------------------------------------------------------
if(requireNamespace("igraph", quietly=TRUE)) {
  igraph_from_graph6(g6)
}

# To network objects -------------------------------------------------------
if(requireNamespace("network", quietly=TRUE)) {
  network_from_graph6(g6)
}

[Package rgraph6 version 2.0-4 Index]