Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 3.29 KB

README.md

File metadata and controls

36 lines (20 loc) · 3.29 KB

try-Rv4.2

Launch Rstudio Binder Blog post

Want to try R v4.2 from the safety of your browser without installing anything? Maybe your organisation hasn't moved to >=v4.1 yet, but you want a chance to noodle around with it.

Read more in the accompanying blog post.

How to

Click the 'launch binder' badge at the top of this README to launch RStudio in your browser, thanks to the Binder project and {holepunch} package. You may need to wait a few moments for it to load.

There's a simple introductory script in the get-started.R file.

New features

There are two major new features to try: the base pipe (|>) and lambda (\()) syntax, which were both introduced in R v4.1. From R news:

R now provides a simple native forward pipe syntax |>. The simple form of the forward pipe inserts the left-hand side as the first argument in the right-hand side call. The pipe implementation as a syntax transformation was motivated by suggestions from Jim Hester and Lionel Henry.

R now provides a shorthand notation for creating functions, e.g. (x) x + 1 is parsed as function(x) x + 1.

An underscore placeholder (_) for the right-hand side of a base pipe was introduced in R v4.2. From R news:

In a forward pipe |> expression it is now possible to use a named argument with the placeholder _ in the rhs call to specify where the lhs is to be inserted. The placeholder can only appear once on the rhs.

Provided packages

Two packages are installed with the Binder instance:

  1. The {dplyr} package authored by Hadley Wickham, Romain François, Lionel Henry and Kirill Müller. Installed so you can compare the base pipe (|>) against the {magrittr} pipe (%>%), which was created by Stefan Milton-Bache and made popular by the tidyverse.
  2. The {pipebind} package by Brenton Wiernik. Installed for you to explore some methods for extending the functionality of the base pipe.