named_elements.Rd
Create a textual notation for nodes or edges.
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.
# 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")#> [1] "epee-=-fibule" "bouclier-=-miroir" #> [3] "epee-=-lance" "bouclier-=-chariot_char" #> [5] "chariot_char-+-cheval" "chariot_char-+-cheval#" #> [7] "arc-=-bouclier" "arc-=-chariot_char" #> [9] "arc-=-miroir" "bouclier-=-fibule" #> [11] "bouclier-=-epee" "epee-=-miroir" #> [13] "arc-+-fleche" "chariot_char-+-roue" #> [15] "chariot_char-+-roue#"# Textual notation of disambiguated nodes named_elements(lgrph[[2]], focus = "nodes", nd.var="type")#> [1] "chariot_char" "bouclier" "arc" "miroir" "fibule" #> [6] "epee" "lance" "cheval" "cheval#" "roue" #> [11] "roue#" "fleche"