pipe: Pipe operator

%>%R Documentation

Pipe operator

Description

This package uses the pipe operator (%>%) to express nested code as a series of imperative procedures.

Arguments

lhs, rhs

An object and a function.

See Also

magrittr::%>%(), tee().

Examples

# set seed for reproducibility
set.seed(500)

# generate 100 random numbers and calculate the mean
mean(runif(100))

# reset the seed
set.seed(500)

# repeat the previous procedure but use the pipe operator instead of nesting
# function calls inside each other.
runif(100) %>% mean()


oppr documentation built on Sept. 8, 2022, 5:07 p.m.