mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-10-28 02:43:08 +08:00
Co-authored-by: nilbuild <4921183+nilbuild@users.noreply.github.com>
884 B
884 B
Pipe
The pipe operator takes the result on its left and passes it as the first argument to the function on its right, letting you chain several operations in a readable, top-to-bottom sequence. R now has two common versions: the native pipe |>, built into base R since version 4.1, and the older magrittr pipe %>%, which predates it and is still common in existing code. Writing data |> filter(x > 0) |> summarize(mean(x)) reads as a sequence of steps rather than a nested jumble of function calls.
Visit the following resources to learn more: