nhs-r-community / intro_r

Workshop materials for revised NHS-R Community "Introduction to R and R Studio" course.
https://nhs-r-community.github.io/intro_r/
Creative Commons Zero v1.0 Universal
25 stars 25 forks source link

Update to base R pipe |> from magrittr %>%? #68

Open Lextuga007 opened 1 year ago

Lextuga007 commented 1 year ago

Following the update that's being written for R4DS the move to the base R pipe is recommended which will require updates to the introduction course and materials.

Tagged this as a question as it's open for discussion on which pipe to use/teach.

Lextuga007 commented 1 year ago

This was discussed on the NHS-R Slack #training channel and responses were positive on teaching the new pipe. Things to note for reference too could be:

x %>% y is valid if y is a function, but you have to use x |> y()

and the . which was automatically fed from {magrittr}'s %>% is:

x |> f(thing, y = _) use _ inplace of .

Finally, the version of R matters and needs to be >4.1 or 4.2 - on the cloud this won't be an issue though.

Lextuga007 commented 1 year ago

Flags for good first issue as much of this can be recoded but some thought needed to where the pipes can be explained a bit more.