I have a graph generated by following code:
library(igraph)
dat <- data.frame(
V0 = c(0L, 100L, 200L, 0L, 0L, 0L, 0L),
V2 = c(0L, 0L, 0L, 0L, 0L, 0L, 0L),
V3 = c(0L, 0L, 0L, 0L, 0L, 0L, 0L),
V4 = c(120L, 0L, 0L, 0L, 0L, 0L, 0L),
V6 = c(0L, 0L, 0L, 30L, 0L, 0L, 0L),
V10 = c(180L, 0L, 0L, 90L, 0L, 0L, 0L),
V12 = c(0L, 0L, 0L, 0L, 30L, 270L, 0L))
rownames(dat) <- c("V0","V2","V3","V4","V6","V10","V12")
dat <- data.matrix(dat)
g2 <- graph_from_adjacency_matrix(dat, weighted=TRUE)
plot(g2, vertex.size = 20, edge.label = E(g2)$weight)
The graph should look like this:
My expected output is to calculate the Weighted In-Degree, Weighted Out-Degree. Thank you a lot