Skip to content

cur_data_all() for rowwise tibble un-nests list variables #5901

@Fuco1

Description

@Fuco1

When accessing current group in a rowwise tibble, the list column's nested values should probably not be expanded. If I have a column with tibbles, they are un-nested and this prevents further processing of the tibble as-is.

library(dplyr, warn.conflicts = FALSE)

f <- function(x) { print(x, n = nrow(x) )}
bla <- tibble(i = 1:2, x = list(tibble(a = 1), tibble(a = 2))) %>% 
  rowwise() %>% 
  summarise(f(cur_data_all()))
#> # A tibble: 1 x 2
#>       i   x$a
#>   <int> <dbl>
#> 1     1     1
#> # A tibble: 1 x 2
#>       i   x$a
#>   <int> <dbl>
#> 1     2     2

Created on 2021-06-03 by the reprex package (v2.0.0)

The same code with group_by(i) does not un-nest the tibble.

Metadata

Metadata

Labels

bugan unexpected problem or unintended behaviorfeaturea feature request or enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions