I am using R and the package igraph to create a bipartite graph based on an incidence matrix, but my weights are not showing? I’ve added an example of what I’m trying to do below. I’ve set weighted=TRUE, and would expect the edges to have different weights, but the lines are all the same thickness. Any suggestions as to what I'm doing wrong?
# Load packages
library(igraph)
# Create data
pNames <- paste("P", 1:4, sep="")
cNames <- paste("c", 1:3, sep="")
rData <- matrix(sample(4,12,replace=TRUE)-1,nrow=4,dimnames=list(pNames,cNames))
print(rData)
# Graph from matrix
b <- graph_from_incidence_matrix(rData,weighted=TRUE)
# Plot with layout
plot(b, layout=layout.bipartite,vertex.color=c("green","cyan")[V(b)$type+1],edge.width = b$weights)