Grouping categorical nodes in igraph

Viewed 38

I am using igraph to make individualized ego-centric network images for people who participated in a larger survey. Participants answered questions about various organizations that they partner with and what their contact with those organizations is like. We grouped these partners into different partner categories.

In igraph, I have been able to label the nodes by category type and have each category type have different colors (e.g., all the business partners are orange and labeled "business"). An example is below.

Example graph

What I need help with: I would like to have all partners of a given partner category clustered together. For example, I want to have all of the hospital partners in the left hand corner, all of the justice partners in the upper center. I do not care where on the graph the clusters appear; I just want all the nodes of a given category to be shown next to each other.

I know that I can manually move nodes around using the below code. But it is my preference to not manually do this and, instead, to write code for this. Do you know how I can do this in igraph?

tkid <- tkplot(net)
0 Answers
Related