plot_nodal_flows: Nodal flows graph

View source: R/nodal_flows.R

plot_nodal_flowsR Documentation

Nodal flows graph

Description

This function plots a dominant flows graph.

Usage

plot_nodal_flows(
  mat,
  leg_pos_flows = "topright",
  leg_flow = "Flows Intensity",
  leg_pos_node = "bottomright",
  leg_node = c("Dominant", "Intermediary", "Dominated",
    "Size proportional\nto sum of inflows"),
  labels = FALSE
)

Arguments

mat

A square matrix of dominant flows (see nodal_flows).

leg_pos_flows

Position of the flows legend, one of "topleft", "top", "topright", "left", "right", "bottomleft", "bottom", "bottomright".

leg_flow

Title of the flows legend.

leg_pos_node

Position of the nodes legend, one of "topleft", "top", "topright", "left", "right", "bottomleft", "bottom", "bottomright".

leg_node

Text of the nodes legend.

labels

A boolean, if TRUE, labels of dominant and intermediary nodes are plotted.

Details

This function uses the Davidson Harel algorithm from igraph.

Note

As square matrices can easily be plotted with plot.igraph or gplot functions from igraph and sna packages, we do not propose visualisation for other outputs.

Examples

nav <- read.csv(system.file("csv/nav.csv", package = "flows"))
mat <- prepare_mat(x = nav, i = "i", j = "j", fij = "fij")
res <- nodal_flows(mat)

# Plot dominant flows graph
plot_nodal_flows(mat = res)

rCarto/flows documentation built on May 10, 2024, 11:38 a.m.