Explore, deconstruct, and analyze pipes.
You can install Mario using the remotes
package:
remotes::install_github("seankross/mario@main")
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