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

overhaul format conversion functions #53

Open
corybrunson opened this issue Apr 3, 2020 · 4 comments
Open

overhaul format conversion functions #53

corybrunson opened this issue Apr 3, 2020 · 4 comments

Comments

@corybrunson
Copy link
Owner

The convenience functions is_*_form() and to_*_form() need a few upgrades:

  • They don't currently accept tidyselect specifications.
  • They still use the weight parameter, whereas the layers have switched to y, which may cause confusion.
  • Internally, to_*_form() rely on tidyr::gather() and tidyr::spread(), which are stable but outdated.
  • to_lodes_form() cannot handle alluvial data with variable y (and weight) values. The new function tidyr::pivot_longer() makes this possible, as illustrated in Longitudianal data  #51. It should be possible to similarly convert from lodes to alluvia form while preserving y (and weight) values using tidyr::pivot_wider().

For consistency between these functions and the layers, it may be prudent to deprecate axis[0-9]+ in favor of x[0-9]+, which would better harmonize with the natural y[0-9]+ that would be used to specify variable y values.

@corybrunson
Copy link
Owner Author

Because the key and value parameters came from tidyr::gather() and tidyr::spread(), whereas some, probably all, of the internal pivoting will be switched to tidyr::pivot_*(), this would be a good time to deprecate these and the id parameters in favor of the x, stratum, and alluvium parameters used by the layers.

@corybrunson
Copy link
Owner Author

There is now a whole book on tidy evaluation, which may be useful for improving the readability and efficiency of the parameter change.

@corybrunson
Copy link
Owner Author

corybrunson commented Aug 19, 2022

Bump.

Also, as the established to_*_form() functions may take a while to deprecate, their tidyr::pivot_*()-based superseders might better be given new names, e.g. pivot_to_*(), so that both could exist simultaneously.

@olivroy
Copy link

olivroy commented Nov 24, 2023

I understand. I could take a look. There are some useful docs on the rlang website. I think it is worth removing the dep on lazyeval to make things more consistent.

I also spotted a defunct function: dplyr::vars_select() in the ggalluvial codebase. its stated replacement is tidyselect::eval_select().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants