I'm loading in the florentine dataset using the code below and trying to visualise the network:
library("ergm")
data("florentine")
require(intergraph)
require(igraph)
marriages <- asIgraph(flomarriage)
# Calculate degree centrality
V(marriages)$degree <- degree(marriages)
# Plot
plot(marriages,
vertex.label.cex = .6,
vertex.label.color = 'blue')
Result:
Question: the nodes have numbers, not the names of the families that exist in the data set (called vertex.names
). How can I replace the node numbers with the names? E.g. is there a label function I could use?