Description Usage Arguments Details Value See Also Examples
View source: R/named_elements.R
Create a textual notation for nodes or edges.
1 2 3 4 | named_elements(grph,
focus = "edges",
nd.var = "type",
disamb.marker = "#")
|
grph |
A decoration graph
(object of class |
focus |
Textual notation of edges ( |
nd.var |
The attribute of the graph nodes containing the node variable (ie, field)
for the textual annotation. By default |
disamb.marker |
Marker used to disambiguated repeated elements.
By default |
Edges of type '='
(normal edges) are undirected, so
that the order of their nodes is irrelevant and they are presented in
alphabetical order.
Conversely, edges of types '+'
(attribute edges) and '>'
(diachronic edges) are directed, so that the given order of
nodes is preserved.
Repeated node or edge names are
disambiguated by appending the symbol disamb.marker
('#'
by
default) at the end of the second appearance (suffix). Subsequent appearances
are marked by additional disamb.marker
s.
A character vector of named nodes or edges.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Read data
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)
# Generate list of graphs from the three data.frames
lgrph <- list_dec(imgs, nodes, edges)
# Textual notation of disambiguated edges
named_elements(lgrph[[2]], focus = "edges", nd.var="type")
# Textual notation of disambiguated nodes
named_elements(lgrph[[2]], focus = "nodes", nd.var="type")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.