Learn R Programming

rmonad (version 0.7.0)

crunch: Cache all large values that are stored in memory

Description

Cache all large values that are stored in memory

Usage

crunch(m)

Arguments

m

Rmonad object

Examples

Run this code
# NOT RUN {
set.seed(42)
m <- as_monad(runif(1e6), tag="a") %>>%
     sqrt %>% tag("b") %>>%
     log %>% tag("c") %>>% prod(2) %>>% prod(3)
m1 <- crunch(m)
get_value(m,  1:3) %>% lapply(head)
get_value(m1, 1:3) %>% lapply(head)
# }

Run the code above in your browser using DataLab