We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In dplyr 1.1.0, the following groups data before performing a mutate:
iris |> mutate(.by = Species, n_in_species = n())
I expected the same to work in tidygraph, but in fact it works like the old interface:
library(tidygraph) data(whigs, package = "ggraph") whigs <- as_tbl_graph(whigs) |> activate(nodes) |> mutate(AM = grepl("^[A-M]", name)) whigs |> mutate(.by = AM, n_in_group = n() ) ... type name AM .by n_in_group <lgl> <chr> <lgl> <lgl> <int> 1 FALSE John Adams TRUE TRUE 261 2 FALSE Samuel Adams FALSE FALSE 261
where the numbers should be more like:
whigs |> group_by(AM) |> mutate(.by = AM, n_in_group = n() ) |> ungroup() ... type name AM .by n_in_group <lgl> <chr> <lgl> <lgl> <int> 1 FALSE John Adams TRUE TRUE 152 2 FALSE Samuel Adams FALSE FALSE 109
This is a silent failure. Until dplyr .by is supported, it might be worth just throwing a warning when .by is used in a dplyr verb.
.by
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In dplyr 1.1.0, the following groups data before performing a mutate:
I expected the same to work in tidygraph, but in fact it works like the old interface:
where the numbers should be more like:
This is a silent failure. Until dplyr
.by
is supported, it might be worth just throwing a warning when.by
is used in a dplyr verb.The text was updated successfully, but these errors were encountered: