briatte / ggnetwork

Geoms to plot networks with ggplot2
https://briatte.github.io/ggnetwork/
146 stars 28 forks source link

ggnetwork plotting fails under dev version of ggplot2 #11

Closed sctyner closed 7 years ago

sctyner commented 7 years ago

I'm sure you're already aware of this (probably received automatically generated emails from Hadley) but ggnetwork fails to plot because of the incompatibility with the new ggproto.

library(geomnet)
library(network)
library(ggnetwork)
data(blood, package = "geomnet")
ggplot(ggnetwork(network(blood$edges[, 1:2]),
                 layout = "circle", arrow.gap = 0.05),
       aes(x, y, xend = xend, yend = yend)) +
  geom_edges(color = "grey50",
             arrow = arrow(length = unit(10, "pt"), type = "closed")) +
  geom_nodes(size = 15, color = "darkred") +
  geom_nodetext(aes(label = vertex.names), color = "grey80") +
  theme_blank()
Error: StatEdges was built with an incompatible version of ggproto.
Please reinstall the package that provides this extension.
sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] network_1.13.0     ggnetwork_0.5.1    geomnet_0.1.2.2    ggplot2_2.1.0.9001

The paper revisions were just about complete when I got my notification from Hadley about the new ggplot2 version. We need to update our packages and put them on CRAN as soon as ggplot2 is released to that we can (finally) submit the paper.

sctyner commented 7 years ago

Hello François!

I believe I have figured out this problem. If ggnetwork is installed when ggplot2 version 2.1.0 is installed in the library, this error arises. My solution was to reinstall ggnetwork, devtools::install_github("briatte/ggnetwork", force = TRUE), and the examples run fine.

In theory, any time this error shows up, the solution is to reinstall the package you're trying to use. The error message, then, is not as cryptic as I first thought!

Cheers, Sam