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

Consider exporting %>% #838

Closed
pawelru opened this issue Mar 7, 2024 · 10 comments
Closed

Consider exporting %>% #838

pawelru opened this issue Mar 7, 2024 · 10 comments

Comments

@pawelru
Copy link
Contributor

pawelru commented Mar 7, 2024

It seems that using pipe (whether it is base or the one coming from magrittr) is practically unavoidable when using rtables. Please consider exporting it out of package namespace to save library calls on the end-user side.

@shajoezhu
Copy link
Collaborator

what about "|>"

@pawelru
Copy link
Contributor Author

pawelru commented Mar 7, 2024

what about "|>"

This is definitely an option but note it's available only starting from R 4.1. How about the users with R <4.1. rtables is very generous in that regard - it has: R (>= 2.10) however I'm not sure if we really support it :P

@Melkiades
Copy link
Contributor

For me it is fine to add either but I think the second (|>) will cause problems downstream as we need to change them all. I would follow @pawelru's suggestion

@pawelru
Copy link
Contributor Author

pawelru commented Mar 7, 2024

For me it is fine to add either

Just to clarify: you don't have to export |>. It's provided by R itself. This is only about %>% pipe with the R<4.1 users in mind.

@shajoezhu
Copy link
Collaborator

a lot of changes indeed. but i think we should move towards higher version of "R" anyway.

@Melkiades
Copy link
Contributor

I agree, but you can use |> already, except for all people who do not use it, even if with R > 4.1, you need to import the pipe somehow in rtables. If we do not, users will be forced to import magrittr (dplyr) on their machine or change all pipes to R's one. It is not a super big deal, but it would be an important change in policy, without too much of a gain, if we anyway drop magrittr dependency. Should we move towards R>4.1 only, in your opinion, @pawelru?

@pawelru
Copy link
Contributor Author

pawelru commented Mar 7, 2024

Should we move towards R>4.1 only

This is a big decision. IMHO too risky right now. I have observed that in the pharma field centrally managed R environments is not rare and these typically adapt at relatively slow pace. In my opinion this is too risky.

@shajoezhu
Copy link
Collaborator

ok, i think we can do "|>" for teal families, as teal's R dependency is already at 4.0

but we can leave the static output ones a bit behind, (including tern)

eventually, when making cards an upstream dependencies of tern, we will switch |> for tern, the rest can stay %>% for a bit longer

@gmbecker
Copy link
Collaborator

gmbecker commented Jun 7, 2024

I'm personally not a fan of adding dplyr/magrittr as an explicit dependency (required for re-export). I'm also not a fan of re-exporting symbols in general as it muddies the waters of where something comes from and where users should go for help on it, etc.

dplyr is already in the suggests, and virtually everyone will have it installed already. just my 2c

@Melkiades
Copy link
Contributor

Melkiades commented Jun 10, 2024

I would honestly close this while waiting for getting native pipes in "|>". Feel free to reopen once you think again this is current

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

4 participants