Learn R Programming

flows (version 1.0)

domflows: Dominant Flows Selection

Description

Dominant flows selection.

Usage

domflows(mat, wi, wj, k)

Arguments

mat
A square matrix of flows.
wi
A vector of row weigths.
wj
A vector of column weigths.
k
A threshold (see 'Details').

Value

  • A boolean matrix of selected flows.

Details

This function selects which flow (fij or fji) must be kept. If the ratio weight of destination (wj) / weight of origin (wi) is greater than k, then fij is selected and fji is not. This function can perform the second criterion of the Nystuen & Dacey's dominants flows analysis. As the output is a boolean matrix, use element-wise multiplication to get flows intensity.

References

J. Nystuen & M. Dacey, 1961, A graph theory interpretation of nodal flows, Papers and Proceedings of the Regional Science Association, vol. 7, 29-42.

See Also

firstflows, firstflowsg, plotDomFlows, plotMapDomFlows

Examples

Run this code
# Import data
data(nav)
myflows <- prepflows(mat = nav, i = "i", j = "j", fij = "fij")

# Remove the matrix diagonal
diag(myflows) <- 0

# Select the dominant flows (incoming flows criterion)
flowSel <- domflows(mat = myflows, wi = colSums(myflows), wj = rowSums(myflows),
                    k = 1)
statmat(mat = myflows * flowSel, output = "none")

Run the code above in your browser using DataLab