From 594129b1b05732d5d167d1c9917a886911987f2e Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Sat, 10 Sep 2022 08:38:12 -0500 Subject: [PATCH] Joins are now polishing --- joins.qmd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/joins.qmd b/joins.qmd index bd9a83f..ecb4a86 100644 --- a/joins.qmd +++ b/joins.qmd @@ -4,7 +4,7 @@ #| results: "asis" #| echo: false source("_common.R") -status("restructuring") +status("polishing") ``` ## Introduction @@ -813,7 +813,8 @@ df |> left_join(df, join_by(id < id)) ### Rolling joins -Rolling joins are a special type of inequality join where instead of getting *every* row that satisfies the inequality, you get just the closest row, as in @fig-join-closest. You can turn any inequality join into a rolling join by adding `closest()`. +Rolling joins are a special type of inequality join where instead of getting *every* row that satisfies the inequality, you get just the closest row, as in @fig-join-closest. +You can turn any inequality join into a rolling join by adding `closest()`. For example `join_by(closest(x <= y))` matches the smallest `y` that's greater than or equal to x, and `join_by(closest(x > y))` matches the biggest `y` that's less than `x`. ```{r}