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

list_transpose() and data frames #1109

Closed
mmuurr opened this issue Nov 20, 2023 · 1 comment
Closed

list_transpose() and data frames #1109

mmuurr opened this issue Nov 20, 2023 · 1 comment
Labels
bug an unexpected problem or unintended behavior tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@mmuurr
Copy link

mmuurr commented Nov 20, 2023

With the transition from transpose() to list_transpose() comes this (new) incompatibility:

> purrr::list_transpose(mtcars)
# Error in `purrr::list_transpose()`:
# ! `x` must be a list, not a <data.frame> object.
# Run `rlang::last_trace()` to see where the error occurred.

> is.list(mtcars)
# [1] TRUE

transpose(), however, still works as expected.

Was this an intentional change? (If there's any voting on the matter, I cast one vote to allow list_transpose() to operate on data frames, which are -- after all -- lists :-))

{purrr} v1.0.2

@hadley hadley added bug an unexpected problem or unintended behavior tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day labels Jul 15, 2024
@hadley
Copy link
Member

hadley commented Jul 15, 2024

I agree. I think it would make sense to replace vec_check_list() (which has been superseded anyway) with a custom error using is.list().

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 tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

No branches or pull requests

2 participants