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