I'm preparing some network data to run ERGMs in R using the statnet library. I want to assign an attribute to the edges that I will use when I run the ERGM. The matrix include numbers between 0 and 1 for each tie in the network. I'm getting an error when I use set.edge.attribute that says "inappropriate value given in set.edge.attribute."
I first thought that there might be an issue with the values in the matrix that contains the attribute I'd like to add. To check this, I created a matrix with random numbers in it and ran the set.edge.attribute code again, but still got the error.
I imported the network and the edge attribute as CSV files, converted the network file into a network object, and converted the edge attribute to a matrix. The edge attribute has the same number of edges in it as the network.
library(statnet)
NetworkGraph = network(NetworkData,type="adjacency", directed=FALSE)
EdgeInfo = as.matrix(EdgeInfo)
NetworkGraph<-set.edge.attribute(NetworkGraph,"edge_attribute", EdgeInfo)
To generate a matrix of attributes to test this with, I used runif to make a new matrix, but I still got the same error):
Test = matrix(runif(23*23), nrow=23, ncol=23)
NetworkGraph<-set.edge.attribute(NetworkGraph,"edge_attribute", Test)
What could make this work?