Learn R Programming

rmonad (version 0.7.0)

loop: Apply an rmonad pipeline function to each element in a rmonad bound list

Description

Apply an rmonad pipeline function to each element in a rmonad bound list

Usage

loop(m, FUN, looper = lapply, ...)

Arguments

m

Rmonad object wrapping a vector

FUN

function of an element from the vector stored in m that returns an Rmonad object.

looper

function that applies each element in the input vector to FUN. The default it lapply.

...

Additional arguments sent to FUN

Value

Rmonad object wrapping a vector of the values wrapped by the outputs of FUN

Examples

Run this code
# NOT RUN {
foo <- function(x) { x %>>% sqrt }
c(256, 6561) %v>% sqrt %>% loop(foo) %>>% lapply(sqrt)
# }

Run the code above in your browser using DataLab