It's a bad idea to have spaces in the names of your variables. Let's just use source
and dest
instead for our variable names:
dat <- data.frame(source=1:3, dest=c(3, 1, 1))
You can make and plot your graph with the graph.data.frame
function:
g <- graph.data.frame(dat)
plot(g)