Greedy one-to-one matching of pairs
greedy(x, y, weight, n = 1L, m = 1L, include_ties = FALSE)
x
: id's of lhs of pairs; converted to integery
: id's of rhs of pairs; converted to integerweight
: numeric vector with weight of pairn
: an integer. Each element of x can be linked to at most n elements of y.m
: an integer. Each element of y can be linked to at most m elements of x.include_ties
: when pairs for a given record have an equal weight, should all pairs be included.A logical vector with the same length as x
.
Pairs with the highest weight are selected as long a neither the lhs as the rhs are already selected in a pair with a higher weight. When include_ties
is TRUE
all pairs are included when multiple pairs for a given record have an equal weight.