I want to conduct centrality analysis, and prior to do that I found that I have to make a graph data first. So I was struggling to make graph with 'graph.data.frame' function with 'igraph' package. This is my code.
links = fread("C:/Users/82109/Documents/centrality_baselayer.csv") links = links %>% select("LINK_ID", "UP_FROM_NO", "UP_TO_NODE") # the first picture nodes = fread("C:/Users/82109/Documents/linkdata.csv") nodes = nodes %>% select("UP_FROM_NO") nodes = unique(nodes) # the second picture
with the code above, I gained following data :
and with the dataframes above and a code below, I tried to make graph.
graph.data.frame(d = links, vertices = nodes, directed = T)
But this error bothers me...
Error in graph.data.frame(d = links, vertices = nodes, directed = T) : Some vertex names in edge list are not listed in vertex data frame
This makes me very embarrassed now...I would be very appreciate if you help me!