seankross / mario

🍄 But our princess is in another castle!
Other
21 stars 1 forks source link

mario

R-CMD-check

Explore, deconstruct, and analyze pipes.

Installation

You can install Mario using the remotes package:

remotes::install_github("seankross/mario@main")

Getting Started

library(tidyverse)
library(mario)

(Formaldehyde %>% 
  slice(1:3) %>% 
  parse_pipeline() -> pipeline_call)

#> Formaldehyde %>% slice(1:3)

pipeline_call %>% 
  get_verbs()

#> [[1]]
#> Formaldehyde
#>
#> [[2]]
#> slice(1:3)

pipeline_call %>% 
  get_data_steps()

#> [[1]]
#> # A tibble: 6 × 2
#>    carb optden
#>   <dbl>  <dbl>
#> 1   0.1  0.086
#> 2   0.3  0.269
#> 3   0.5  0.446
#> 4   0.6  0.538
#> 5   0.7  0.626
#> 6   0.9  0.782
#> 
#> [[2]]
#> # A tibble: 3 × 2
#>    carb optden
#>   <dbl>  <dbl>
#> 1   0.1  0.086
#> 2   0.3  0.269
#> 3   0.5  0.446

Related Work