Commits

Nic Crane authored d5f80cbe2b2
ARROW-11699: [R] Implement dplyr::across() for mutate() This PR introduces a partial implementation for `dplyr::across()` when called within `dplyr::mutate()`. ``` r arrow_table(iris) %>% mutate(across(starts_with("Sepal"), list(round, sqrt))) #> Table (query) #> Sepal.Length: double #> Sepal.Width: double #> Petal.Length: double #> Petal.Width: double #> Species: dictionary<values=string, indices=int8> #> Sepal.Length_1: double (round(Sepal.Length, {ndigits=0, round_mode=HALF_TO_EVEN})) #> Sepal.Length_2: double (sqrt_checked(Sepal.Length)) #> Sepal.Width_1: double (round(Sepal.Width, {ndigits=0, round_mode=HALF_TO_EVEN})) #> Sepal.Width_2: double (sqrt_checked(Sepal.Width)) #> #> See $.data for the source Arrow object ``` I've opened a number of follow-up tickets for the tasks needed to be done to provide a more complete implementation: * [ARROW-17362: [R] Implement dplyr::across() inside summarise()](https://issues.apache.org/jira/browse/ARROW-17362) * [ARROW-17387: [R] Implement dplyr::across() inside filter()](https://issues.apache.org/jira/browse/ARROW-17387) * ~[ARROW-17364: [R] Implement .names argument inside across()](https://issues.apache.org/jira/browse/ARROW-17364)~ (now done in this PR, will close it once this is merged) * [ARROW-17366: [R] Support purrr-style lambda functions in .fns argument to across()](https://issues.apache.org/jira/browse/ARROW-17366) Closes #13786 from thisisnic/ARROW-11699_across Authored-by: Nic Crane <thisisnic@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>