I'm trying to analyse a bipartite network using the R bipartite package. I imported a csv file and converted it to a one mode network. Here's my code:
library(igraph)
library(bipartite)
g <- as.network(data)
net <- as.one.mode(g, fill = 0, project="full", weighted=TRUE)
summary(net)
vcount(net)
ecount(net)
But, when I try to calculate network metrics using the following command, it gives me an error.
betweenness_w(net, directed=NULL, alpha=1)
Here's the error message.
Error in if (NC == 2) net <- data.frame(tmp[, 1], tmp[, 2]) :
argument is of length zero
I appreciate some help