Description Usage Arguments Details Value See Also Examples
Flow selection from origins.
1 | firstflows(mat, method = "nfirst", ties.method = "first", k)
|
mat |
A square matrix of flows. |
method |
A method of flow selection, one of "nfirst", "xfirst" or "xsumfirst":
|
ties.method |
In case of equality with "nfirst" method, use "random" or "first" (see rank). |
k |
Selection threshold. |
As the output is a boolean matrix, use element-wise multiplication to get flows intensity.
A boolean matrix of selected flows.
firstflowsg, domflows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Import data
data(nav)
myflows <- prepflows(mat = nav, i = "i", j = "j", fij = "fij")
# Remove the matrix diagonal
diag(myflows) <- 0
# Select the 2 first flows of each origin
flowSel <- firstflows(mat = myflows, method = "nfirst", ties.method = "first",
k = 2)
statmat(mat = myflows * flowSel, output = "none")
# Select flows greater than 2000
flowSel <- firstflows(mat = myflows, method = "xfirst", k = 2000)
statmat(mat = myflows * flowSel, output = "none")
# Select as many flows as necessary for each origin so that their sum is at
# least equal to 20000
flowSel <- firstflows(myflows, method = "xsumfirst", k = 20000)
statmat(mat = myflows * flowSel, output = "none")
# Select each flows that represent at least 10% of the outputs
myflowspct <- myflows / rowSums(myflows) * 100
flowSel <- firstflows(mat = myflowspct, method = "xfirst", k = 10)
statmat(mat = myflows * flowSel, output = "none")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.