I am trying to visualize a network using ggraph. My code is as follows:
ggraph(x, layout = "fr") +
geom_edge_link(aes(width = weight), alpha = 0.50, edge_color = "grey20") +
geom_node_point(color = "black", size = 12, show.legend = FALSE, family = "serif") +
geom_node_label(aes(label = name),
repel = TRUE, show.legend = FALSE, family = "serif") +
theme_graph(background = "white")
It results in the following snippet of network plot:
Is it possible to create labels inside the nodes in ggraph? I tried geom_node_label and geom_node_text but none of them works that way. I also upload an example of what I have in mind below:
I would really appreciate your help. I wish everyone a healthy summer.