from <- c("a", "a", "a", "x", "x", "c")
to <- c("b", "c", "x", "y", "c", "a")
weight <- c(3.4, 2.6, 1.7, 5.3, 1.6, 7.9)
df <- data.frame(from, to, weight)
g1 <- graphBAM(df, edgemode = "directed")
adjacencyMatrix(g1)
Run the code above in your browser using DataLab