Skip to content
New issue

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

unnest should handle lists #278

Closed
hadley opened this issue Mar 5, 2017 · 0 comments
Closed

unnest should handle lists #278

hadley opened this issue Mar 5, 2017 · 0 comments
Labels
feature a feature request or enhancement rectangling 🗄️ converting deeply nested lists into tidy data frames

Comments

@hadley
Copy link
Member

hadley commented Mar 5, 2017

library(tidyr)
library(tibble)

df <- tibble(
  x = 1:2,
  y = list(
    list("a", "b"),
    list("c", "d")
  )
)

df %>% unnest(y)
#> Error: Each column must either be a list of vectors or a list of data frames [y]

# expected:
tibble(
  x = c(1, 1, 2, 2),
  y = list("a", "b", "c", "d")
)
#> # A tibble: 4 × 2
#>       x         y
#>   <dbl>    <list>
#> 1     1 <chr [1]>
#> 2     1 <chr [1]>
#> 3     2 <chr [1]>
#> 4     2 <chr [1]>

Originally at tidyverse/purrr#265

@hadley hadley added the feature a feature request or enhancement label Jun 23, 2017
@hadley hadley added rectangling 🗄️ converting deeply nested lists into tidy data frames and removed rectangling 🗄️ converting deeply nested lists into tidy data frames labels Nov 16, 2017
@hadley hadley closed this as completed in f418817 Nov 20, 2017
dipetkov added a commit to dipetkov/actigraph.sleepr that referenced this issue Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement rectangling 🗄️ converting deeply nested lists into tidy data frames
Projects
None yet
Development

No branches or pull requests

1 participant