Closed antagomir closed 5 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?
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)
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!
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