Pipes have been a fundamental aspect of computer programming for many decades. In short, the semantics of pipes can be thought of as taking the output from the left-hand side and passing it as input to the right-hand side. For example, in a linux shell, you might
cat example.txt | unique | sort to take the contents of a text file, then take one copy of each row, then sort those remaining rows.
| is a common, but not universal, pipe operator and on U.S. Qwerty keyboards, is found above the backslash key:
Languages that don’t begin by supporting pipes often eventually implement some version of them. In R, the magrittr package introduced the
%>% infix operator as a pipe operator and is most often pronounced as “then”. For example, “take the
mtcars data.frame, THEN take the
head of it, THEN…” and so on.