While there are some questions dealing with creating a graph from an adjacency matrix, I haven't found much about extracting the weighted adjacency matrix from a weighted graph.
Say I have the following graph:
library(igraph)
nodes <- data.frame(name=c("a","b", "c", "d", "f", "g"))
col1 <- c("a", "g", "f","f", "d","c")
col2 <- c("b", "f","c","d","a","a")
weight <- c(1,4,2,6,2,3)
edges <- cbind.data.frame(col1,col2,weight)
g <- graph.data.frame(edges, directed=F, vertices=nodes)
E(g)$weight <- weight
How do I get the weighted adjacency matrix of graph g?