list_dec.Rd
Create undirected graphs for each decoration from nodes
, edges
and imgs
dataframes and store the graphs in a list.
The join between these dataframes is done on the two fields site
and decor
.
Graph names refer to imgs$idf
.
list_dec(imgs, nodes, edges)
imgs | Dataframe of decorations |
---|---|
nodes | Dataframe of nodes |
edges | Dataframe of edges |
A list of igraph
graphs.
# Read imgs, nodes and edges dataframes imgs <- read.table(system.file("extdata", "imgs.csv", package = "iconr"), sep=";", stringsAsFactors = FALSE) nodes <- read.table(system.file("extdata", "nodes.csv", package = "iconr"), sep=";", stringsAsFactors = FALSE) edges <- read.table(system.file("extdata", "edges.csv", package = "iconr"), sep=";", stringsAsFactors = FALSE) # Create the list of graphs lgrph <- list_dec(imgs, nodes, edges) # Get the first graph g <- lgrph[[1]] g#> IGRAPH 45063c5 UN-B 7 8 -- 1 #> + attr: name (g/n), site (g/c), decor (g/c), lbl (g/c), img (g/c), name #> | (v/c), type (v/c), x (v/n), y (v/n), type (e/c) #> + edges from 45063c5 (vertex names): #> [1] 1--4 1--5 3--5 1--2 1--7 1--3 1--8 4--8# Graph name g$name#> [1] 1# Graph label g$lbl#> [1] "1-Cerro Muriano.Cerro Muriano 1"#> [1] 7#> [1] 8