Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Fuco1 opened this issue Jun 1, 2021 · 0 comments · Fixed by #6020
Closed

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

Fuco1 opened this issue Jun 1, 2021 · 0 comments · Fixed by #6020
Assignees
Labels
bug an unexpected problem or unintended behavior feature a feature request or enhancement
Milestone

Comments

@Fuco1
Copy link

Fuco1 commented Jun 1, 2021

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.

@romainfrancois romainfrancois changed the title cur_data_all for rowwise tibble un-nests list variables cur_data_all() for rowwise tibble un-nests list variables Jun 3, 2021
@romainfrancois romainfrancois self-assigned this Sep 17, 2021
@romainfrancois romainfrancois added this to the 1.0.8 milestone Sep 17, 2021
@romainfrancois romainfrancois added bug an unexpected problem or unintended behavior feature a feature request or enhancement labels Sep 17, 2021
romainfrancois added a commit that referenced this issue Sep 21, 2021
* cur_data() / cur_data_all() not simplifying list columns on rowwise data frames.

closes #5901

* NEWS

* Apply suggestions from code review

Co-authored-by: Hadley Wickham <h.wickham@gmail.com>

Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants