So I would like to evaluate homophily against a random network. This means I need to create a random network with the attributes that I am interested in. Getting the random network is easy enough, but I can't add attributes because the random networks don't have anything I can join by...
gr = play_erdos_renyi(6, 0.3)
Attr = sample.int(3, 6, replace = TRUE
gr <- gr %>%
activate(nodes) %>%
join(Attr)
I think I could first generate the random network, then spit that into an edgelist, then add attributes to the edgelist, and then use graph_from_data_frame to get the network, but it feels like there should be some easier way to do this.