I'm having an issue with the order edges are plotted with geom_edge_link() - I need them to respect the order of factor levels (factor cat below) and to have different widths according to value in strength.
I would expect edges to be plotted in "order" they appear in the edge list that feeds tbl_graph but that does not seem to be the case - what should be the expected behaviour?
Consider the following dataframe
from <- c("A","A","A","A","A","B","B","B","B","B","C","C","D","D","D","D","D","D","D","D","E","E","E","E","E","F","F","G","G","G","G","G","G")
to <- c("H","I","I","J","O","O","H","I","I","N","N","H","N","J","H","J","J","I","I","J","L","N","J","L","H","L","H","M","J","N","I","H","H")
cat <- c("weak","moderate","strong","v_strong","weak","moderate","strong","v_strong","weak","moderate","strong","v_strong","weak","weak","weak","weak","weak","weak","moderate","strong","v_strong","moderate","moderate","moderate","moderate","strong","v_strong","weak","weak","weak","weak","strong","v_strong")
strength <- c(0.7,1,0.4,0.9,0,0,0.2,0.4,0.2,0.6,0.5,0.3,1,0.5,0.6,0.2,0.5,0.7,1,0,0.2,0.8,0.5,0.4,0.1,0,0.7,0.2,0.5,0.7,0.3,0.4,0.6)
df <- data.frame(from, to, cat, strength)
Hi - great package! Thanks!
I'm having an issue with the order edges are plotted with geom_edge_link() - I need them to respect the order of factor levels (factor cat below) and to have different widths according to value in strength.
I would expect edges to be plotted in "order" they appear in the edge list that feeds tbl_graph but that does not seem to be the case - what should be the expected behaviour?
Consider the following dataframe
Order the level in factor 'cat'
edge list
edge.list <- df
node list
tbl_graph file
Netw <- tbl_graph(nodes = node.list, edges = edge.list)
plot it!
I get this:
However, I would expect the red edges (i.e. level "weak") to be in the 'back' and over all the other edges.
I tried different things but just don't understand if this is the expected behaviour and how I can obtain my desired output.
Thanks for your help!