set.seed(123)
V <- LETTERS[1:4]
edL <- vector("list", length=4)
names(edL) <- V
toE <- LETTERS[4:1]
for(i in 1:4)
edL[[i]] <- list(edges=5-i, weights=runif(1))
gR <- graphNEL(nodes=V, edgeL=edL)
listEdges(gR)
Run the code above in your browser using DataLab