When trying to use geom_conn_bundle()
I systematically get this error:
Error in
geom_conn_bundle()
:
! Problem while computing layer data.
Error occurred in the 1st layer.
Caused by error inlayer_data()
:
!layer_data()
must return a <data.frame>
Not sure it's relevant, but I'm using R 4.2.1 on an Ubuntu 22.04 machine. The ggraph package is updated to the last CRAN version. Below a minimal example causing the error.
library(tidygraph)
library(ggraph)
graph <- as_tbl_graph(highschool) |>
mutate(Popularity = centrality_degree(mode = 'in'))
ggraph(graph, layout = 'kk') +
geom_conn_bundle() +
geom_node_point()