Description Usage Arguments Value Examples
Generates either numeric or color scales for specified edge attributes and applies those scales to edge data frames.
1 | scale_edges(edges_df, to_scale, edge_attr, range, scale_type = "linear")
|
edges_df |
a data frame containing, at minimum, a column (called |
to_scale |
a vector of numerical values to be scaled; these currently need to be of the same length and order as the edge operations in the supplied edge data frame, so, it's recommended to reference a column of values available in |
edge_attr |
the name of the edge attribute for which scaled values are to be created. |
range |
a vector of 2 elements providing either lower and upper numerical or X11 color values. |
scale_type |
the type of scaling to perform. Currently, |
an edge data frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# 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))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.