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

map_df() can't make a list-column #264

Closed
jennybc opened this issue Nov 25, 2016 · 1 comment
Closed

map_df() can't make a list-column #264

jennybc opened this issue Nov 25, 2016 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@jennybc
Copy link
Member

jennybc commented Nov 25, 2016

library(purrr)
library(tibble)
x <- list(list(a = "a",
               n = 1:2),
          list(a = "A",
               n = 3:7))
x %>% {
  tibble(
    a = map_chr(., "a"),
    n = map(., "n")
  )
}
#> # A tibble: 2 × 2
#>       a         n
#>   <chr>    <list>
#> 1     a <int [2]>
#> 2     A <int [5]>
x %>% map_df(`[`, c("a", "n"))
#> Error: incompatible sizes (1 != 2)
@hadley hadley added the bug an unexpected problem or unintended behavior label Mar 3, 2017
@hadley
Copy link
Member

hadley commented Mar 5, 2017

Moved to dplyr; I'm not 100% sure this should work, but it's worth thinking about.

@hadley hadley closed this as completed Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants