Description Usage Arguments Note See Also Examples
This function plots a dominant flows graph.
1 2 3 4 | plotDomFlows(mat, legend.flows.pos = "topright",
legend.flows.title = "Flows Intensity", legend.nodes.pos = "bottomright",
legend.node.txt = c("Dominant", "Intermediary", "Dominated",
"Size proportional\nto sum of inflows"), labels = FALSE)
|
mat |
A square matrix of dominant flows (see domflows). |
legend.flows.pos |
Position of the flows legend, one of "topleft", "top", "topright", "left", "right", "bottomleft", "bottom", "bottomright". |
legend.flows.title |
Title of the flows legend. |
legend.nodes.pos |
Position of the nodes legend, one of "topleft", "top", "topright", "left", "right", "bottomleft", "bottom", "bottomright". |
legend.node.txt |
Text of the nodes legend. |
labels |
A boolean, if TRUE, labels of dominant and intermediary nodes are plotted. |
As square matrices can easily be plot with plot.igraph or gplot functions from igraph and sna packages, we do not propose visualisation for other outputs.
domflows, plotMapDomFlows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # 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)
flowSel1 <- domflows(mat = myflows, w = colSums(myflows), k = 1)
# Select the first flows
flowSel2 <- firstflows(mat = myflows, method = "nfirst", ties.method = "first",
k = 1)
# Combine selections
flowSel <- myflows * flowSel1 * flowSel2
# Plot dominant flows graph
plotDomFlows(mat = flowSel, legend.flows.title = "Nb. of commuters")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.