# Add an edge attribute which has values scaled to
# numeric data in another column
edges <- create_edges(from = c("a", "b", "c"),
to = c("d", "d", "a"),
label = '',
relationship = "given_to",
data = sample(seq(1:50), 10))
edges <- scale_edges(edges_df = edges,
to_scale = edges$data,
edge_attr = "penwidth",
range = c(1, 5))
Run the code above in your browser using DataLab