same_elements | R Documentation |
Create the (symmetric) dataframe with the count of common nodes or common edges (see list_compar
for comparison criteria) for each pair of decorations (graphs) from a list. The diagonal of the symmetric dataframe is filled with counts of nodes/edges for each decoration.
same_elements(lgrph, nd.var = "type", focus = "nodes")
lgrph |
a list of any number of graphs to be pairwise compared. The list can be typically obtained with the function |
nd.var |
an attribute of the graph vertices containing the node variable (ie, field) on which the comparison will be done. By default |
focus |
either |
A symmetric matrix with the counts of the pairwise coincidences of nodes or edges. The matrix has as row and column names the names of the corresponding graphs in the input list.
list_dec
, list_compar
, plot_compar
.
# read imgs, nodes and edges dataframes
imgs <- read.table(system.file("extdata", "imgs.tsv", package = "iconr"),
sep="\t",stringsAsFactors = FALSE)
nodes <- read.table(system.file("extdata", "nodes.tsv", package = "iconr"),
sep="\t",stringsAsFactors = FALSE)
edges <- read.table(system.file("extdata", "edges.tsv", package = "iconr"),
sep="\t",stringsAsFactors = FALSE)
lgrph <- list_dec(imgs,nodes,edges)
# Counting same nodes
df.same_nodes <- same_elements(lgrph, nd.var = "type",
focus = "nodes")
df.same_nodes
## a symmetric matrix of nodes comparisons
# same edges
df.same_edges <- same_elements(lgrph, nd.var = "type",
focus = "edges")
df.same_edges
## a symmetric matrix of edges comparisons
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.