best-cost / best-cost_WPs

This repository aim to collect the confidential (not public) work of the EU project BEST-COST in the framework of the workpackages (WPs).
1 stars 0 forks source link

Potential incompatibilities with R base pipes #305

Closed ungatoverde closed 1 month ago

ungatoverde commented 1 month ago

R base pipes (|>) have been implemented here #304

Good news in terms of performance, but we have to aware from now that if conditions and dots(.) are not supported in based pipes.

Another important risk:

Because the native pipe wasn’t introduced until 4.1.0, code using |> in function reference examples or vignettes will not work on older versions of R, as it is not valid syntax

See https://www.tidyverse.org/blog/2023/04/base-vs-magrittr-pipe/#using-the-native-pipe-in-packages

Any implications for us? @luytax: Thankful if you have a look at this and try to prevent problems associated to the use of R base pipes in our package

luytax commented 1 month ago

The safest option would be to declare R version 4.1.0 (first version with native pipe) as the minimum R version for running our package, by adjusting the Depends field in the DESCRIPTION file. https://github.com/best-cost/best-cost_WPs/blob/e7ad6cc06aa7a021f4a5b2f1b7618591386d355b/r_package/bestcost/DESCRIPTION#L15-L16 This should prevent all possible problems. R 4.1.0 came out in (June 2021), which will be 5 years ago by the time our package will be published. If you agree @ungatoverde, we can change Depends field to R 4.1.0

ungatoverde commented 1 month ago

Agree! @luytax

luytax commented 1 month ago

Done here