I have an igraph where the vertexes only have their IDs (V(g)$name
). I also have a data.frame in this format that match each ID to a name:
ID name
1 Ann
2 Bob
3 Carl
...
I would like to add the names to the vertex (V(g)$label
) by matching the ID. The graph does not have all the IDs the names frame has.
I think it should be rather simple but as I'm new to R I'm not quite sure as how to do it.