Closed cobac closed 6 months ago
Maybe this is not an issue of dplyr side? It is one feature that summarise()
can use variable generated by previous expressions. For example, this will work:
table |>
summarise(word_median = median(word), n = length(word_median))
The workaround might be call across()
first, and then your other three expressions.
is one feature that summarise() can use variable generated by previous expressions
Oh, I was not aware of that. Thanks.
I run into this behavior the other day, which I have to assume is a bug.
Running on dplyr 1.1.4, R 4.3.2.
When performing some aggregations with
summarise()
, if the name of the new columns contain the name of some of the original columns, the function breaks.The new columns e.g.
max_word
contain the name of the original columnword
.If they don't, the function works as expected.
This is only the case when using
across()
withinsummarise()
.