prep_flowmap | R Documentation |
prep_flowmap
prep_flowmap(
flowdat = NULL,
od = NULL,
nodes = NULL,
k_nodes = NULL,
node_buffer_factor = 1.2,
node_radius_factor = 1,
edge_offset_factor = 1,
node_fill_factor = NULL,
edge_width_factor = 1.2,
arrow_point_angle = 45
)
flowdat |
Input dataframe. See details below. |
od |
As an alternative to |
nodes |
As an alternative to |
k_nodes |
Number of clusters to group nodes into. If defined, nodes will be clustered hierarchically based on spatial proximity. By default, no clustering will be applied. |
node_buffer_factor |
Controls the distance between the nodes and the edges ( in multiple of the nodes' radii). |
node_radius_factor |
Controls the size of the nodes. |
edge_offset_factor |
Controls the distance between the parallel arrows. |
node_fill_factor |
Controls the downscaling of the fill of the nodes ( as to not outshine the edges ). |
edge_width_factor |
Controls the width of the edges. |
arrow_point_angle |
Controls the pointiness of the edges. |
A list with two dataframes: edges and nodes. The edges dataframe contains the coordinates of the edges, and the nodes dataframe contains the coordinates of the nodes. Additional list elements contain the maximum and minimum width of the arrows.
testdata <-
data.frame(
id_a = c("X1","X2","X3","X3","X1"),
id_b = c("X8","X7","X1","X8","X7"),
xa = c(2,14,10,10,2),
ya = c(6,10,9,9,6),
xb = c(10,4,2,10,4),
yb = c(4,10,6,4,10),
flow_ab = c(2,1,1,1,1),
flow_ba = c(5,1,1,1,2))
flowmapper:::prep_flowmap(testdata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.