I really like the new tidyr interface that came with v1.0.0.
However, with the tidyverse more or less being centered around tibble, I was a bit puzzled that the nested column seems to be a list of data.frames - even when the original data was a tibble to begin with (in which case I would have expected that I end up with a list of tibbles in the nested column):
library(magrittr)
df <- tibble::tribble(
~id, ~x, ~y,
1, 10, 20,
1, 100, 200,
2, 1, 2
)
df
#> # A tibble: 3 x 3
#> id x y
#> <dbl> <dbl> <dbl>
#> 1 1 10 20
#> 2 1 100 200
#> 3 2 1 2
df %>% tidyr::nest_legacy(-id)
#> # A tibble: 2 x 2
#> id data
#> <dbl> <list>
#> 1 1 <tibble [2 x 2]>
#> 2 2 <tibble [1 x 2]>
df %>% tidyr::nest(data = -id)
#> # A tibble: 2 x 2
#> id data
#> <dbl> <list<df[,2]>>
#> 1 1 [2 x 2]
#> 2 2 [1 x 2]
Is there any way the get to exact same result that tidyr::nest_legacy() gave/gives me?