I'm struggling with some social network mapping with R using igraph. I would like to produce a plot showing the relationships of local representative (e.g. Bill) with individuals and administrative bodies in their area. I've been able to plot vertices for Bill and his contacts with edges using the following in a graph.data.frame
:
who contact weight associate
Bill district 1 y
Bill region 2 n
Bill village A 1 y
Bill village B 2 n
Bill social worker 1 n
Bill steve 1 y
Bill church 2 n
Bill jane 1 y
Bill village A Admin 1 n
Bill village B Admin 1 n
I would like to differentiate the vertices by color as to whether or not they are one of Bill's associates. I tried
V(g)$color <- ifelse(V(g)
but get either an error message or nothing changes. I would also like to differentiate the edges in different colors by weight to represent between Bill's direct or indirect contacts using the weight variable.
Any guidance on how I can enhance Bill's plot or whether I should be using a different dataframe would be greatly appreciated.