The piece traces how the forward-pipe pattern (data |> f |> g) entered R, beginning with a 2012 StackOverflow prompt and early one-off implementations (Ben Bolker’s first pipe, Peter Meilstrup’s chain in ptools/vadr). It documents dplyr’s 2013 addition of a chain and the %.% operator, Stefan Bache’s December 2013 plumbr → magrittr creation of %>%, and the subsequent convergence: dplyr adopted %>% (deprecating %.%) and RStudio added a pipe shortcut (now Ctrl+Shift+M). The magrittr name nods to Magritte. Example transformations (hflights) illustrate how pipes simplified nested function calls into linear, readable sequences.
The narrative then covers alternative pipe packages (pipeR’s %>>% with placeholders and result-saving, wrappr’s dot-arrow %.>%), efforts to add a native pipe to base R (work by Lionel Henry, Luke Tierney and others), and the introduction of the native |> operator in R 4.1.0 (May 2021). It notes magrittr 2.0’s C implementation for speed and highlights practical differences: |> requires an explicit function call on the RHS and lacks magrittr’s dot (.) placeholder, necessitating inline functions \(x) for non-first-argument placement. The account lists additional magrittr pipes and peripheral notes (data.table’s stance, pronunciation debates) and concludes that piping fundamentally changed R coding.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.