# Set network with two vertex attributes
nw <- network.initialize(100)
nw <- set.vertex.attribute(nw, "race", value = rep(0:1, each=50))
nw <- set.vertex.attribute(nw, "sex",
value = c(rep("M", 10), rep("F", 90)))
# Formation formula uses both attributes
formation <- ~ edges + nodematch("race") + nodematch("sex")
# Get existing proportions of those two terms
get.nodematch.attributes(nw, formation)
Run the code above in your browser using DataLab