You can do this using igraph
(which calls this type of network bipartite).
Assume you have created a data frame with your excel data in it, called dt.
dt
Movie director codirector staff1
1 StarWars JJAbrams <NA> Anne
2 Abarter JamesCameron <NA> <NA>
3 Loiter Kenn Klark Kage
Then you can create a bipartite graph, g
as follows:
library(reshape2)
edgelist <- melt(dt, id.vars = 'Movie')[, -2]
edgelist <- edgelist[complete.cases(edgelist), ]
library(igraph)
g <- graph.data.frame(edgelist)
V(g)$type <- V(g)$name %in% edgelist[, 1]
g
plot(g)
IGRAPH DN-B 9 6 --
+ attr: name (v/c), type (v/l)
+ edges (vertex names):
[1] StarWars->JJAbrams Abarter ->JamesCameron Loiter ->Kenn Loiter ->Klark
[5] StarWars->Anne Loiter ->Kage

In igraph
a bipartite graph is a regular graph with each vertex having a type attribute set to TRUE/FALSE
. It doesn't matter which type of vertex is which, in this case Movies are set to TRUE
.