igraph is very flexible, and I'm sure there are several ways to do this. I found the tutorials presented on the website to be very useful.
Here is one simple way to create a network diagram from a data.frame file:
library(igraph)
df <- data.frame(
A = c("Berlin", "Amsterdam", "New York") ,
B = c("Munich", "Utrecht", "Chicago"))
df.g <- graph.data.frame(d = df, directed = FALSE)
plot(df.g, vertex.label = V(df.g)$name)

source
share