We're loving the package and all the fantastic options.
We couldn't reproduce this with any of the default datasets, so – unfortunately – we have to bother you with our own reprex.
library(ggraph)
library(igraph)
graphlong <- structure(list(categories = c("A", "A", "A", "B", "B", "B", "B",
"C", "C", "C", "C", "C", "C", "C", "C", "C", "D", "D", "D", "D",
"E", "E", "E", "E", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"F", "G", "G", "G", "G", "H", "H", "H", "H", "H", "H", "H", "H",
"H", "H", "H", "I", "I", "K", "K", "K", "K", "K"), items = c("immer_dasselbe",
"karawane", "krokodil", "widerstand", "bienensprachen", "immer_dasselbe",
"morgen", "boeses_huhn", "boeses_huhn", "boeses_huhn", "laender",
"laender", "laender", "nuschel", "nuschel", "nuschel", "graue_haare",
"kopf_verdrehen", "unnuetzes_gedicht", "zeitwortmelodie", "nachtlied",
"unnuetzes_gedicht", "wende", "zeitwortmelodie", "ausserirdischer_besuch",
"kopf_verdrehen", "je_desto", "kakadu", "komma", "tiere_fressen",
"marktkram", "opa_essen", "stoerung", "aus_dem_lexikon", "kakadu",
"stoerung", "aber_wie", "ich_wir", "unterschied", "erfindungen",
"karawane", "krokodil", "muecke_elefant", "schuld", "unnuetzes_gedicht",
"vergleichsweise", "widerstand", "zeitwortmelodie", "zensiert",
"komma", "opa_essen", "ausserirdischer_besuch", "boeses_huhn",
"krokodil", "muecke_elefant", "osterhase"), Subcode = structure(c(5L,
5L, 5L, 3L, 3L, 3L, 3L, 3L, 1L, 13L, 3L, 1L, 13L, 3L, 1L, 13L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 13L, 13L, 13L, 13L, 13L, 13L,
13L, 13L, 13L, 13L, NA, NA, NA, NA, 12L, 12L, 12L, 12L, 12L,
12L, 12L, 12L, 12L, 12L, 12L, 2L, 2L, 5L, 5L, 5L, 5L, 5L), .Label = c("Genre",
"sprachlich", "textuell", "kommunikativ", "medial", "Handlung_Zustand",
"Zeit", "Objekt", "Figur", "Ort", "metakognitiv", "epistemisch",
"affektiv", "intertextuell", "generativ", "Primär_leserseitig"
), class = "factor"), Supercode = c("Sprache", "Sprache", "Sprache",
"Sprache", "Sprache", "Sprache", "Sprache", "Sprache", "Sprache",
"Modalität", "Sprache", "Sprache", "Modalität", "Sprache",
"Sprache", "Modalität", "Sprache", "Sprache", "Sprache", "Sprache",
"Sprache", "Sprache", "Sprache", "Sprache", "Modalität", "Modalität",
"Modalität", "Modalität", "Modalität", "Modalität", "Modalität",
"Modalität", "Modalität", "Modalität", NA, NA, NA, NA, "Modalität",
"Modalität", "Modalität", "Modalität", "Modalität", "Modalität",
"Modalität", "Modalität", "Modalität", "Modalität", "Modalität",
"Sprache", "Sprache", "Sprache", "Sprache", "Sprache", "Sprache",
"Sprache")), .Names = c("categories", "items", "Subcode", "Supercode"
), row.names = c(NA, 56L), class = "data.frame")
glon_graph <- igraph::graph_from_data_frame(d = graphlong, directed = FALSE)
g <- ggraph(graph = glon_graph, layout = "bipartite", types = igraph::bipartite_mapping(graph = glon_graph)$type)
g <- g + geom_edge_fan(mapping = aes(start_cap = label_rect(node1.name), end_cap = label_rect(node2.name)))
g <- g + geom_node_label(aes(label = name), repel = FALSE, hjust = "inward")
g <- g + coord_flip()
plot(g)
We're loving the package and all the fantastic options.
We ran into a bit of a glitch with using the (very appealing)
start_cap = label_rect(node1.name)etc. aesthetics in our example; some of the edges just completely freak out and go to0,0in the plot.We couldn't reproduce this with any of the default datasets, so – unfortunately – we have to bother you with our own reprex.
sessionInfo()gives:cc @verenakasztantowicz