# NOT RUN {
d <- data.frame(x=c(1,1,1,2,2,3,3), y=c(1,2,3,4,5,6,7), w=1:7)
# One-to-one matching:
d[match_n_to_m(d$x, d$y, d$w), ]
# N-to-one matching:
d[match_n_to_m(d$x, d$y, d$w, n=999), ]
# One-to-m matching:
d[match_n_to_m(d$x, d$y, d$w, m=999), ]
# N-to-M matching, e.g. select all pairs
d[match_n_to_m(d$x, d$y, d$w, n=999, m=999), ]
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab