vspinu / unnest

Very fast spreading and stacking of nested data structures into R data.frames
https://github.com/vspinu/unnest
10 stars 1 forks source link

Stacking of empty vectors produces NAs #8

Open vspinu opened 2 years ago

vspinu commented 2 years ago
Browse[2]> unnest(list(a = 1:3, b = numeric()), s(stack = "ix", as = "point", s(stack = "id")))
  ix point
1  a     1
2  a     2
3  a     3
4  b    NA
Browse[2]> unnest(list(a = as.list(1:3), b = list()), s(stack = "ix", as = "point", s(stack = "id")))
  ix point point.id
1  a     1        1
2  a     2        2
3  a     3        3
4  b    NA       NA
Browse[2]>