library(igraph)
# Creating a sample graph
g <- sample_gnp(10, 0.3)
V(g)$name <- letters[1:10]
V(g)$color <- rainbow(10)
layout <- layout_with_fr(g)
# Plot the graph using easyplot
easyplot(g, layout, label_size = 1, vertex_size = rep(10, vcount(g)))
# Assign edge colors based on source node colors
g <- assign_edge_colors(g, transparency = 0.4)
# Plot the graph using easyplot, now with edge color
easyplot(g, layout, label_size = 1, vertex_size = rep(10, vcount(g)))
Run the code above in your browser using DataLab