Augment Matching Results with Original Data (broom-style)
Source:R/matching_join.R
augment.matching_result.RdS3 method for augmenting matching results following the broom package
conventions. This is a thin wrapper around join_matched() with
sensible defaults for quick exploration.
Usage
# S3 method for class 'matching_result'
augment(x, left, right, ...)Arguments
- x
A matching_result object
- left
The original left dataset
- right
The original right dataset
- ...
Additional arguments passed to
join_matched()
Value
A tibble with matched pairs and original data (see join_matched())
Details
This method follows the augment() convention from the broom package,
making it easy to integrate couplr into tidymodels workflows. It's
equivalent to calling join_matched() with default parameters.
If the broom package is not loaded, you can use couplr::augment()
to access this function.
Examples
left <- data.frame(
id = 1:5,
treatment = 1,
age = c(25, 30, 35, 40, 45)
)
right <- data.frame(
id = 6:10,
treatment = 0,
age = c(24, 29, 36, 41, 44)
)
result <- match_couples(left, right, vars = "age")
couplr::augment(result, left, right)