# Add a node attribute which has values scaled to
# numeric data in another column
nodes <- create_nodes(nodes = 1:5,
label = FALSE,
type = "example",
data = sample(seq(1:20), 5))
nodes <- scale_nodes(nodes_df = nodes,
to_scale = nodes$data,
node_attr = "penwidth",
range = c(2, 5))
Run the code above in your browser using DataLab