Is it possible to construct a graph in network
that only contains nodes but not edges from a data frame? The data structure looks as follows:
library(statnet)
ID <- as.character(rep(1:10, each = 1, times = 1))
class <- rep(c("class1","class2"), each = 5, times = 1)
unit <- rep(c('unit1', 'unit2'), each = 1, times = 5)
net_data <- as.data.frame(cbind(ID, class, unit)))
ID
is the node ID and class
and unit
are supposed to be node attributes. I could also work with an igraph
solution but I'm curious if this is possible.