tidyverse / tidyr

Tidy Messy Data
https://tidyr.tidyverse.org/
Other
1.37k stars 417 forks source link

`.by` support in `fill()`/`complete()`/`expand()` #1439

Open markfairbanks opened 1 year ago

markfairbanks commented 1 year ago

To match the .by implementation in dplyr v1.1.0 functions.

DavisVaughan commented 1 year ago

Will have to wait for tidyr 1.4.0 (i.e. after dplyr 1.1.0 is released)

hadley commented 1 year ago

@DavisVaughan does it have to? We added it to the upcoming dbplyr release.

DavisVaughan commented 1 year ago

That seems different though because dbplyr controls the whole underlying implementation. Here we just pass through to a dplyr function like mutate() or summarise(), so without dplyr 1.1.0 the arguments wouldn't do anything.

I guess we could check to see if dplyr 1.1.0 is installed if .by is attempted to be used and error if there isn't a new enough version of dplyr, but that didn't feel worth it when I originally thought about this

hadley commented 1 year ago

Ok, makes sense.

mattwarkentin commented 1 year ago

Absolutely love the addition of the per-operation .by/by arguments in dplyr. Now that dplyr 1.1.0 is released, will these be added to the aforementioned tidyr functions. Seems like tidyr::nest() already got the makeover.

DavisVaughan commented 1 year ago

We will add them in the next tidyr release. It was easier with nest() because tidyr owns the implementation. With the others we call out to dplyr so we needed to wait on 1.1.0