Description Usage Arguments Value Examples
a zest join is similar to a dplyr::nest_join()
but the rows of y
that are
included in the list column are controlled by a predicate.
1 |
x |
a tibble |
y |
another tibble |
... |
named predicate formulas The rhs of the formulas is used y
|
a tibble that contains all columns and rows of x
, plus an additional list column per formula:
its name is given by the name of the formula
each element of the column is a tibble
each of the tibbles is a subset of y
according to the rhs of the formula
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | tbl <- tibble::tibble(cyl = c(4, 6, 8), mpg = c(30, 25, 20))
# zest join of tbl and mtcars
# - the created column is called `data`
# - each element of the data column is the result of filter(mtcars, cyl == !!cyl & mpg < !!mpg)
# - `cyl` and `mpg` refer to columns of `y`
# - `!!cyl` and `!!mpg` refer to the current
tbl %>%
zest_join(mtcars, data = ~cyl == !!cyl & mpg < !!mpg)
# similar to
tbl %>%
rap(data = ~filter(mtcars, cyl == !!cyl & mpg < !!mpg))
# multiple zest
tbl %>%
zest_join(mtcars,
one = ~cyl == !!cyl & mpg < !!mpg,
two = ~cyl < !!cyl & mpg > !!mpg
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.