nonbimatch {nbpMatching} | R Documentation |
Nonbipartite Matching
Description
The nonbinmatch function creates the set of pairwise matches that minimizes the sum of distances between the pairs.
Usage
nonbimatch(mdm, threshold = NA, precision = 6, ...)
Arguments
mdm |
A distancematrix object. See the distancematrix function. |
threshold |
An numeric value, indicating the distance needed to create chameleon matches. |
precision |
The largest value in the matrix will have at most this many digits. The default value is six. |
... |
Additional arguments, these are not used. |
Details
The nonbinmatch function calls the Fortran code (Derigs) and set of pairwise matches that minimizes the sum of distances between the pairs.
Value
nonbimatch S4 object with several elements
matches |
data.frame containing matches |
halves |
data.frame containing each match |
total |
sum of the distances across all pairs |
mean |
mean distance for each pair |
Author(s)
Cole Beck
See Also
Examples
plainmatrix<-as.matrix(dist(sample(1:25, 8, replace=TRUE)))
diag(plainmatrix) <- 99999 # setting diagonal to an infinite distance for
# pedagogical reasons (the diagonal may be left
# as zero)
mdm<-distancematrix(plainmatrix)
res<-nonbimatch(mdm)
[Package nbpMatching version 1.5.5 Index]