-
Couldn't load subscription status.
- Fork 421
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"
Description
library(tidyr)
df <- tibble(x = 1:2, y = tibble(a = 1:2, b = 3:4, c = 5:6))
df
#> # A tibble: 2 x 2
#> x y$a $b $c
#> <int> <int> <int> <int>
#> 1 1 1 3 5
#> 2 2 2 4 6
unchop(df, y)
#> Error in rep(vec_seq_along(data), n): invalid 'times' argument
# should be more like this
unpack(df, y)
#> # A tibble: 2 x 4
#> x a b c
#> <int> <int> <int> <int>
#> 1 1 1 3 5
#> 2 2 2 4 6This is because [[ is being used internally to do the slicing, and this isn't correct for data frame columns. It should use vec_slice2() r-lib/vctrs#626
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"