Calculates weightings between nodes for a network diagram.

make_edges(
  connections_data,
  node_id,
  node_number,
  connection_id,
  join_col = deparse(substitute(connection_id)),
  from_to_col = NULL,
  weight_col = NULL,
  weight_col_fun = NULL,
  ...
)

Arguments

connections_data

Dataframe detailing connections between nodes, as generated via make_connections(). This can have duplicate rows for node - connection object combinations, to account for how edge weighting should be handled.

node_id

Original ID (can be character) for each node as per source dataframe.

node_number

Numeric ID for each node - can be generated as per make_connections().

connection_id

Field to connect related nodes as per initial source data.

join_col

Column (as character string) to join connections data back onto itself. Defaults to the connection_id field.

from_to_col

Column (character string "from" or "to") use in determining which is from node and which is to node. You need to pre-define this column if you want to use the functionality. If not provided, which node is selected as from and to will depend on the node_number.

weight_col

Column used to set edge weights. If not set, a count of unique connecting objects between nodes will be used.

weight_col_fun

Function to apply to weight_col() data to get edges.

...

Additional arguments to pass to weight_col_fun().

Value

A dataframe containing details of vertices between nodes, including weights. Note this will have unique rows for each node-to-node combination.