I have an edge list in Excel that looks like this:
from to weighted
a b 5
c b 0
d b 20
a c 1
b c 30
d f 1
How can I read this edge list and visualize it as a weighted network? I currently have:
library(igraph)
library("readxl")
data <- read_excel("Sample.xlsx")
g <- graph_from_data_frame(data, directed = TRUE, vertices = NULL)
plot(g)
But the plot doesn't show the edge weights. What function should I use to visualize the weights?