I've built a dependency graph using ggnet2 and am trying to set the size of the vertex based on Cost, which is a numeric attribute in the node data structure.
The issue is calling the method set.vertex.attribute
.
x = data.frame(ID = network.vertex.names(deps))
for (i in names(df)) {
y = merge(x, df, by = "ID", sort = F)[,i]
set.vertex.attribute(deps, i, as.character(y))
}
If I passing an integer, it complains that Inappropriate value given in set.vertex.attribute
. A similar issue was reported here
If I remove the loop and add the attribute for the whole vector, all is well.