firstflowsg
From flows v1.1.1
by Timothe Giraud
Flow Selection Based on Global Criteria
Flow selection based on global criteria.
Usage
firstflowsg(mat, method = "nfirst", k, ties.method = "first")
Arguments
 mat
 A square matrix of flows.
 method
 A method of flow selection, one of "nfirst", "xfirst" or "xsumfirst":
 nfirst selects the k first flows of the matrix,
 xfirst selects flows greater than k,
 xsumfirst selects as many flows as necessary so that their sum is at least equal to k.
 k
 Selection threshold.
 ties.method
 In case of equality with "nfirst" method, use "random" or "first" (see rank).
Details
As the output is a boolean matrix, use elementwise multiplication to get flows intensity.
Value

A boolean matrix of selected flows.
See Also
Examples
# 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")
Community examples
Looks like there are no examples yet.