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

Comments

Projects
None yet
1 participant
@hadley
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 label Jun 23, 2017

@hadley hadley added trees 🌲 and removed trees 🌲 labels Nov 16, 2017

@hadley hadley closed this 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