if(requireNamespace("igraph", quietly = TRUE)) {
set.seed(1)
plot(
EF3,
layout = igraph::layout.fruchterman.reingold,
vertex.color = igraph::V(EF3)$type+1,
vertex.label.family = "",
sub = "Source: Echenique & Fryer (2006)",
main = "Neighborhood racial segregation\n in a fictional city"
)
}
Run the code above in your browser using DataLab