Closed
Description
Here is an example that produces the problem:
df <- tibble(
a = list(c(1, 2), 3),
b = c(4,5)
)
df %>%
unnest(a) %>%
colnames
# [1] "b" "a"
df %>%
filter(b==1) %>%
unnest(a) %>%
colnames
# [1] "b"
If the special case occurs that the tibble being unnested has no rows, all code acting on the unnested column breaks.