The package now includes intelligent preprocessing to improve matching quality:
auto_scale parameter in match_couples() and greedy_couples() enables automatic preprocessingpreprocess_matching_vars() function for manual preprocessing controlComprehensive tools to assess matching quality:
balance_diagnostics() function computes multiple balance metrics:balance_table() creates publication-ready formatted tablesCreate analysis-ready datasets directly from matching results:
join_matched() function automates data preparation:left_vars and right_vars parameters_left, _right) for overlapping columnspair_id, distance, block_idaugment() method for tidymodels integration:join_matched() parametersinclude_distance - Include/exclude matching distanceinclude_pair_id - Include/exclude sequential pair IDsinclude_block_id - Include/exclude block identifiersleft_id and right_idPerformance optimization for exploring multiple matching strategies:
compute_distances() function precomputes and caches distance matrices:join_matched()distance_object):match_couples() and greedy_couples()match_couples(dist_obj, max_distance = 5)update_constraints():max_distance or calipers without recomputing distancesmatch_couples(left, right = NULL, vars = NULL, ...)Speed up blocked matching with multi-core processing:
parallel parameter in match_couples() and greedy_couples():parallel = TRUE for automatic configurationparallel = "multisession" or other future planfuture package:Like testthat, couplr makes errors light, memorable, and helpful with couple-themed messages:
check_costs parameter (default: TRUE) in match_couples() and greedy_couples():FALSE to skip checks in production codediagnose_distance_matrix():options(couplr.emoji = FALSE) if preferredpreprocess_matching_vars() - Main preprocessing orchestratorbalance_diagnostics() - Comprehensive balance assessmentbalance_table() - Formatted balance tables for reportingjoin_matched() - Create analysis-ready datasets from matching resultsaugment.matching_result() - Broom-style interface for joined datacompute_distances() - Precompute and cache distance matricesupdate_constraints() - Modify constraints on distance objectsis_distance_object() - Type checking for distance objectsdiagnose_distance_matrix() - Comprehensive distance diagnosticscheck_cost_distribution() - Check for distribution problemsexamples/auto_scale_demo.R - 5 preprocessing demonstrationsexamples/balance_diagnostics_demo.R - 6 balance diagnostic examplesexamples/join_matched_demo.R - 8 joined dataset demonstrationsexamples/distance_cache_demo.R - Distance caching and reuse examplesexamples/parallel_matching_demo.R - 7 parallel processing examplesexamples/error_messages_demo.R - 10 fun error message demonstrationsThe package has been renamed from lapr to couplr to better reflect its purpose as a general pairing and matching toolkit.
couplr = Optimal pairing and matching via linear assignment
First official stable release with clean, well-organized codebase.
morph_* naming prefixassignment() (low-level) + lap_solve() (tidy)src/core/ - Utilities and headerssrc/interface/ - Rcpp exportssrc/solvers/ - 14 LAP algorithmssrc/gabow_tarjan/ - Gabow-Tarjan solversrc/morph/ - Image morphingHungarian, Jonker-Volgenant, Auction (3 variants), SAP/SSP, SSAP-Bucket, Cost-scaling, Cycle-cancel, Gabow-Tarjan, Hopcroft-Karp, Line-metric, Brute-force, Auto-select
✅ Tidy tibble interface ✅ Matrix & data frame inputs ✅ Grouped data frames ✅ Batch solving + parallelization ✅ K-best solutions (Murty, Lawler) ✅ Rectangular matrices ✅ Forbidden assignments (NA/Inf) ✅ Maximize/minimize ✅ Pixel morphing visualization
lap_solve() - Main tidy interfacelap_solve_batch() - Batch solvinglap_solve_kbest() - K-best solutionsassignment() - Low-level solverget_total_cost(), as_assignment_matrix(), etc.pixel_morph(), pixel_morph_animate()Development history under "lapr" available in git log before v1.0.0.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.