Skip to contents

Create network objects from 'graph6', 'sparse6', or 'digraph6' symbols

Usage

network_from_text(object)

Arguments

object

character vector of 'graph6', 'sparse6', or 'digraph6' symbols

Value

A list of 'network' objects.

Examples

# complete graph in graph6 format
g6 <- "G~~~~{"

# random graph with 15 nodes
s6 <- ":NeF?bsl?aNC"

# random directed graph with 10 nodes
d6 <- "&I???GGGI?_gG??O???"

network_from_text(g6)
#> [[1]]
#>  Network attributes:
#>   vertices = 8 
#>   directed = FALSE 
#>   hyper = FALSE 
#>   loops = FALSE 
#>   multiple = FALSE 
#>   bipartite = FALSE 
#>   total edges= 28 
#>     missing edges= 0 
#>     non-missing edges= 28 
#> 
#>  Vertex attribute names: 
#>     vertex.names 
#> 
#> No edge attributes
#> 
network_from_text(c(g6,s6,d6))
#> [[1]]
#>  Network attributes:
#>   vertices = 8 
#>   directed = FALSE 
#>   hyper = FALSE 
#>   loops = FALSE 
#>   multiple = FALSE 
#>   bipartite = FALSE 
#>   total edges= 28 
#>     missing edges= 0 
#>     non-missing edges= 28 
#> 
#>  Vertex attribute names: 
#>     vertex.names 
#> 
#> No edge attributes
#> 
#> [[2]]
#>  Network attributes:
#>   vertices = 15 
#>   directed = FALSE 
#>   hyper = FALSE 
#>   loops = FALSE 
#>   multiple = FALSE 
#>   bipartite = FALSE 
#>   total edges= 9 
#>     missing edges= 0 
#>     non-missing edges= 9 
#> 
#>  Vertex attribute names: 
#>     vertex.names 
#> 
#> No edge attributes
#> 
#> [[3]]
#>  Network attributes:
#>   vertices = 10 
#>   directed = TRUE 
#>   hyper = FALSE 
#>   loops = FALSE 
#>   multiple = FALSE 
#>   bipartite = FALSE 
#>   total edges= 10 
#>     missing edges= 0 
#>     non-missing edges= 10 
#> 
#>  Vertex attribute names: 
#>     vertex.names 
#> 
#> No edge attributes
#>