I have an edgelist that I want to convert it to a weighted graph. I used the below code:
edgelist <- read.table(text = "
V1 v2 weights
A B 1
B C 8
C D 6
D E 9
C F 12
F G 15",header=T)
g<-graph_from_data_frame(edgelist)
g
It makes the weights as an attribute for the edges. However, when I want to check if it is weighted or not means:
is_weighted(g)
It returns me FALSE
. How can I change it to TRUE
?