list_dec: Create Decoration's Graphs and Store them in a List

Description Usage Arguments Value See Also Examples

View source: R/list_dec.R

Description

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.

Usage

1
2
3
  list_dec(imgs,
           nodes,
           edges)

Arguments

imgs

Dataframe of decorations

nodes

Dataframe of nodes

edges

Dataframe of edges

Value

A list of igraph graphs.

See Also

graph_from_data_frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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

# Graph name
g$name

# Graph label
g$lbl

# Graph number of nodes
igraph::gorder(g)

# Graph number of edges
igraph::gsize(g)

iconr documentation built on Feb. 16, 2021, 5:06 p.m.