-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviornesting 🐦nesting, chopping, and packingnesting, chopping, and packing
Description
Was somewhat horrified to learn that the ptype argument doesn't work as expected in unnest() here because of the preprocessing that is done on the unnest() side before handing off to unchop():
library(tidyr)
df <- tibble(
terms = list("x", c("y", "z")),
predictors = list("a", c("b", "c"))
)
ptype <- tibble(terms = character(), predictors = character())
unnest(
data = df,
cols = c(terms, predictors),
ptype = ptype
)
#> Error: Can't convert <data.frame> to <character>.
unchop(
data = df,
cols = c(terms, predictors),
ptype = ptype
)
#> # A tibble: 3 × 2
#> terms predictors
#> <chr> <chr>
#> 1 x a
#> 2 y b
#> 3 z cThis has been fixed in the dev version with the unchop/unnest() upgrades, but a test would be nice to ensure this doesn't happen again in unnest(). And since it is technically a fix we could add a bullet in NEWS.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviornesting 🐦nesting, chopping, and packingnesting, chopping, and packing