I'm trying to create an igraph network object by using the graph_from_dataframe
. My target is to map out interactions in a large group. For this, I have a dataframe of vertices (i.e. list of the actors (approx 200) with their name and different attributes) and a dataframe of interactions (i.e. and edge list with two columns, 'initiator' and 'supporter').
Not all actors of the group are involved in the interaction, so there are isolate nodes. However, when I run the command, I get an igraph error:
"Some vertex names in edge list are not listed in vertex data frame".
I have double checked that my CSV vertices data includes all the names which are included in my CSV edge list's both columns. However, because not all are involved, they are not present in the edge listing. I'm perplexed by the error because shouldn't the message should be vice versa – some names in the vertex list are not listed in the edge list?
library(igraph)
links <- read.csv2("edgelist.csv")
vertices <- read.csv2("vertices.csv")
network <- graph_from_data_frame(d=links,vertices = vertices,directed = TRUE)
Error in graph_from_data_frame(d = links, vertices = vertices, :
Some vertex names in edge list are not listed in vertex data frame