closest() now in dev dplyr
This commit is contained in:
parent
8e0e6db1d2
commit
4ac50eb359
|
@ -855,17 +855,10 @@ And for each employee we want to find the first party date that comes after (or
|
||||||
We can express that with a rolling join:
|
We can express that with a rolling join:
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
#| eval: false
|
|
||||||
employees |>
|
employees |>
|
||||||
left_join(parties, join_by(closest(birthday >= party)))
|
left_join(parties, join_by(closest(birthday >= party)))
|
||||||
```
|
```
|
||||||
|
|
||||||
```{r}
|
|
||||||
#| echo: false
|
|
||||||
employees |>
|
|
||||||
left_join(parties, join_by(preceding(birthday, party)))
|
|
||||||
```
|
|
||||||
|
|
||||||
### Overlap joins
|
### Overlap joins
|
||||||
|
|
||||||
Overlap joins provide three helpers that use inequality joins to make it easier to work with intervals:
|
Overlap joins provide three helpers that use inequality joins to make it easier to work with intervals:
|
||||||
|
|
Loading…
Reference in New Issue