Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yonicd/ripe
rerun {magrittr} pipelines
https://github.com/yonicd/ripe
magrittr magrittr-pipes r
Last synced: 2 months ago
JSON representation
rerun {magrittr} pipelines
- Host: GitHub
- URL: https://github.com/yonicd/ripe
- Owner: yonicd
- License: other
- Created: 2018-08-16T22:39:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T10:51:57.000Z (about 5 years ago)
- Last Synced: 2024-08-13T07:15:34.479Z (4 months ago)
- Topics: magrittr, magrittr-pipes, r
- Language: R
- Homepage: https://yonicd.github.io/ripe/
- Size: 715 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - yonicd/ripe - rerun {magrittr} pipelines (R)
README
---
output: github_document
always_allow_html: yes
---[![CRAN status](https://www.r-pkg.org/badges/version/ripe)](https://CRAN.R-project.org/package=ripe)
[![R-win build status](https://github.com/yonicd/ripe/workflows/R-win/badge.svg)](https://github.com/yonicd/ripe)
[![R-mac build status](https://github.com/yonicd/ripe/workflows/R-mac/badge.svg)](https://github.com/yonicd/ripe)
[![R-linux build status](https://github.com/yonicd/ripe/workflows/R-linux/badge.svg)](https://github.com/yonicd/ripe)
[![Codecov test coverage](https://codecov.io/gh/yonicd/ripe/branch/master/graph/badge.svg)](https://codecov.io/gh/yonicd/ripe?branch=master)
[![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2019_11_20-brightgreen.svg)](http://tinyurl.com/vzcsnsa)```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)library(ripe)
```# ripe
The goal of ripe is to create a more flexible way to rerun {magrittr} pipelines.
## Installation
```{r,eval=FALSE}
remotes::install_github('yonicd/ripe')
```## Goal
We want to rerun the following pipeline that contains stochastic elements in a shorter and more flexible way
```{r}
f <- function(){
stats::runif(20)%>%
sample(10)%>%
utils::head(5)
}set.seed(123)
replicate(n=3,f(),simplify = FALSE)
```
## Can't I just add replicate to the end of it?
```{r}
set.seed(123)
stats::runif(20)%>%
sample(10)%>%
utils::head(5)%>%
replicate(n = 3,simplify = FALSE)
```That didn't do what we wanted...
## This is better!
```{r}
set.seed(123)
stats::runif(20)%>%
sample(10)%>%
utils::head(5)%>%
ripe(replicate,n=3,simplify=FALSE)
```## Manipulate Pipeline Replicates
We can now manipulate the pipeline or move `ripe` around into different subsets of the function sequence, creating iterative replication workflows.
```{r}
set.seed(123)
stats::runif(20)%>%
#sample(10)%>%
utils::head(5)%>%
ripe(replicate,n=3,simplify=FALSE)
```## Convert Pipelines to Lazy Functions
You can also quickly convert the pipelines to a lazyeval function
```{r}
f <- stats::runif(20)%>%
sample(10)%>%
utils::head(5)%>%
lazy()set.seed(123)
f()
f()
```