Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R] Allow package name prefix inside dplyr::across's .fns argument #32960

Closed
Tracked by #33107
asfimport opened this issue Sep 14, 2022 · 2 comments
Closed
Tracked by #33107

[R] Allow package name prefix inside dplyr::across's .fns argument #32960

asfimport opened this issue Sep 14, 2022 · 2 comments
Assignees
Milestone

Comments

@asfimport
Copy link

This is not a major issue, but may be worth mentioning as a known limitation.

library(dplyr, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)
mtcars |> arrow::arrow_table() |> mutate(across(starts_with("c"), base::as.character)) |> collect()
#> Error in base(cyl): could not find function "base"

Reporter: SHIMA Tatsuya / @eitsupi
Assignee: Nicola Crane / @thisisnic

PRs and other links:

Note: This issue was originally created as ARROW-17724. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Nicola Crane / @thisisnic:
Nicely spotted. This is due to is.name((fns)) in the across_setup() function evaluating to TRUE for as.character and FALSE for base::as.character. Adding is.call(fns) to the list of conditions for identifying single functions may work (needs testing to confirm), or potentially replacing is.name(fns) with is.call(fns) or another function entirely.

@asfimport
Copy link
Author

Nicola Crane / @thisisnic:
Issue resolved by pull request 14279
#14279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants