set.seed(123)
df = data.frame(from = sample(letters, 10, replace = TRUE),
to = sample(letters, 10, replace = TRUE),
value = 1:10)
adjacencyList2Matrix(df)
adjacencyList2Matrix(df, square = TRUE)
Run the code above in your browser using DataLab