Fix #407. unnest works with S3 vectors. #419
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #407 by using
dplyr::combine()
to combine factors, dates and other supported S3 vector types.dplyr
does not offer a way to know ifdplyr::combine()
will succeed based on the types of the vector given, so we use atryCatch
to capture the error and report accordingly. Maybe a better solution will appear when r-lib/vctrs#7 comes to reality.Apologies if anyone else was working on this issue. I was affected by it, and given my previous work on
dplyr::combine()
and theCollecter
class fromdplyr
(tidyverse/dplyr#2209, tidyverse/dplyr#2487) I thought this was a low hanging fruit for me. I can close the PR if anyone has a better solution in mind.Thanks for your time 😄