from_sparse6 {rgraph6}R Documentation

Parsing 'sparse6' symbols

Description

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

Usage

edgelist_from_sparse6(s6)

igraph_from_sparse6(s6)

network_from_sparse6(s6)

Arguments

s6

character vector of 'sparse6' symbols

Value

The returned object is:

See Also

as_sparse6() for encoding network data objects as 'sparse6' symbols.

Examples

elm <- structure(c(1, 1, 2, 2, 4, 4, 5, 6, 9, 10, 7, 8, 4, 8, 6, 8,  
  8, 5, 4, 6), .Dim = c(10L, 2L))
s6 <- as_sparse6(elm, n = 10)

# To edgelist matrix -------------------------------------------------------
edgelist_from_sparse6(s6)

# To igraph object ---------------------------------------------------------
if(requireNamespace("igraph", quietly=TRUE)) {
  igraph_from_sparse6(s6)
}

# To network object --------------------------------------------------------
if(requireNamespace("network", quietly=TRUE)) {
  network_from_sparse6(s6)
}


[Package rgraph6 version 2.0-4 Index]