Skip to content
Justice Tech School

The Pipe Operator

|> passes the left side as the first argument of the function on the right.

Example
x <- c(4, 9, 16)
x |> sqrt() |> sum() |> print()
square <- function(v) v ^ 2
1:3 |> square() |> rev() |> print()

Exercise

Pass x into sqrt.

x |> ()

Quiz Test

What does the pipe pass?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.