eitsupi commented on issue #37529:
URL: https://github.com/apache/arrow/issues/37529#issuecomment-1704045178
Hi, I think `mutate_at` has been superseded by `across` and `across` is
supported by the `arrow` package.
``` r
cols_to_change <- c("disp", "hp")
mtcars |>
arrow::as_arrow_table() |>
dplyr::mutate(dplyr::across(all_of(cols_to_change), ~ dplyr::if_else(.x >
200, "Yes", "No"))) |>
dplyr::collect()
#> # A tibble: 32 × 11
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> <dbl> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 21 6 No No 3.9 2.62 16.5 0 1 4 4
#> 2 21 6 No No 3.9 2.88 17.0 0 1 4 4
#> 3 22.8 4 No No 3.85 2.32 18.6 1 1 4 1
#> 4 21.4 6 Yes No 3.08 3.22 19.4 1 0 3 1
#> 5 18.7 8 Yes No 3.15 3.44 17.0 0 0 3 2
#> 6 18.1 6 Yes No 2.76 3.46 20.2 1 0 3 1
#> 7 14.3 8 Yes Yes 3.21 3.57 15.8 0 0 3 4
#> 8 24.4 4 No No 3.69 3.19 20 1 0 4 2
#> 9 22.8 4 No No 3.92 3.15 22.9 1 0 4 2
#> 10 19.2 6 No No 3.92 3.44 18.3 1 0 4 4
#> # ℹ 22 more rows
```
<sup>Created on 2023-09-03 with [reprex
v2.0.2](https://reprex.tidyverse.org)</sup>
The dplyr document <https://dplyr.tidyverse.org/reference/mutate_all.html>
says:
> Scoped verbs (_if, _at, _all) have been superseded by the use of
[pick()](https://dplyr.tidyverse.org/reference/pick.html) or
[across()](https://dplyr.tidyverse.org/reference/across.html) in an existing
verb. See
[vignette("colwise")](https://dplyr.tidyverse.org/articles/colwise.html) for
details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]