knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) library(ripe)
The goal of ripe is to create a more flexible way to rerun {magrittr} pipelines.
remotes::install_github('yonicd/ripe')
We want to rerun the following pipeline that contains stochastic elements in a shorter and more flexible way
f <- function(){ stats::runif(20)%>% sample(10)%>% utils::head(5) } set.seed(123) replicate(n=3,f(),simplify = FALSE)
set.seed(123) stats::runif(20)%>% sample(10)%>% utils::head(5)%>% replicate(n = 3,simplify = FALSE)
That didn't do what we wanted...
set.seed(123) stats::runif(20)%>% sample(10)%>% utils::head(5)%>% ripe(replicate,n=3,simplify=FALSE)
We can now manipulate the pipeline or move ripe
around into different subsets of the function sequence, creating iterative replication workflows.
set.seed(123) stats::runif(20)%>% #sample(10)%>% utils::head(5)%>% ripe(replicate,n=3,simplify=FALSE)
You can also quickly convert the pipelines to a lazyeval function
f <- stats::runif(20)%>% sample(10)%>% utils::head(5)%>% lazy() set.seed(123) f() f()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.