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 no longer handles lists with date vectors #407
Comments
I think the change happened in commit f418817 to make Lines 144 to 155 in f418817
There is an And it seems to mean than unnest cannot handles any typed element because if I understand well library(dplyr, warn.conflicts = F)
library(tidyr)
as.factor(month.name) %>%
list() %>%
data_frame(x = .) %>%
unnest()
#> Error: Each column must either be a list of vectors or a list of data frames [x]
hms::hms(hours = 1:10) %>%
list() %>%
data_frame(x = .) %>%
unnest()
#> Error: Each column must either be a list of vectors or a list of data frames [x] Created on 2018-02-10 by the reprex package (v0.2.0). This is an issue with more than dates vectors... |
Minimal reprex: library(tidyr)
df <- tibble::tibble(x = as.list(as.factor(letters[1:3])))
unnest(df)
#> Error: Each column must either be a list of vectors or a list of data frames [x] @thays42 in the future, I'd appreciate it if you didn't include session info unless it's explicitly asked for, or you've used |
The type coercion of S3 vectors relies on dplyr::combine. dplyr does not offer a way to know if dplyr::combine will succeed based on the types of the vector given, so we use a tryCatch for now.
Fixed in 96ded3f |
Reproducible example:
Using the above, I am unable to unnest
df1
but can get around it by coercing dates to integers and then back to dates.Below is my
sessionInfo()
:The text was updated successfully, but these errors were encountered: