tidyverse / purrr

A functional programming toolkit for R
https://purrr.tidyverse.org/
Other
1.27k stars 274 forks source link

losing tbl_df class after lmap #1051

Open py-b opened 1 year ago

py-b commented 1 year ago

Applying lmap to a tibble now returns a simple data.frame.

I'm pretty sure the class c("tbl_df", "tbl", "data.frame") was preserved (before version 1.0?).

iris %>% tibble::as_tibble() %>% lmap(identity) %>% class()
#> [1] "data.frame"
hadley commented 1 year ago

Hmmm, it looks like I totally removed data frame support in #895 and then partially bought back support in 2ad46d508d46b5630fbe5bcd89e532538f11ab79. I can't remember exactly why, but this problem of matching the input type is much harder than I originally thought when we first wrote this function.

py-b commented 1 year ago

Maybe you brought it back because the example with disjoin is very useful?