briatte / ggnet

Network visualization with ggplot2
https://briatte.github.io/ggnet/
194 stars 33 forks source link

bipartite plotting issue #26

Closed antagomir closed 5 years ago

antagomir commented 7 years ago

The bipartite network plotting seems to fail in the following example. When the number of rows exceeds the number of columns it does work. I am not sure if this is an inherent technical limitation of bipartite graphs here. If it is, the function could provide at least an informative error message.

x <- matrix(rgamma(8*8, shape = 1), nrow = 8, ncol = 8); bip <- network::network(x, matrix.type = "bipartite"); p <- ggnet2(bip); print(p)

This produces an error: Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 16, 8

briatte commented 7 years ago

Alright. I have been meaning to update ggnet and ggnetwork for a while now, but am teaching too much to allow for nightly debugging sessions…

Would you mind trying your example with ggnetwork, to see if it also fails?

antagomir commented 7 years ago

Ok. This produces an empty graph.

library(ggnetwork) library(network) x <- matrix(rgamma(8*8, shape = 1), nrow = 8, ncol = 8); bip <- network::network(x, matrix.type = "bipartite"); n <- ggnetwork(bip) p <- ggplot(n) print(p)

briatte commented 5 years ago

Closing because I'm failing to get an error message with the example code. @antagomir, all apologies for never coming back to this issue… Hope you're good!