Giter Site home page Giter Site logo

flow's Introduction

flow

The goal of flow is to make it easy to extract numbers for population defining flowcharts with minimal edits to existing dplyr workflows.

Note that this is an extremely early stage (practically idea concept) package.

Installation

You can install the development version with:

# install.packages("devtools")
devtools::install_github("mikmart/flow")

Example

You can flow::track the number of rows dropped with dplyr::filter:

library(dplyr)

filtered <- mtcars %>%
  flow::track("1974 Motor Trend cars") %>%
  filter(mpg >= 20, mpg <= 30) %>%
  filter(cyl < 6)

The result looks like a regular tbl_df ...

filtered
#> # A tibble: 7 x 11
#>     mpg   cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb
#>   <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1  22.8     4  108     93  3.85  2.32  18.6     1     1     4     1
#> 2  24.4     4  147.    62  3.69  3.19  20       1     0     4     2
#> 3  22.8     4  141.    95  3.92  3.15  22.9     1     0     4     2
#> 4  21.5     4  120.    97  3.7   2.46  20.0     1     0     3     1
#> 5  27.3     4   79     66  4.08  1.94  18.9     1     1     4     1
#> 6  26       4  120.    91  4.43  2.14  16.7     0     1     5     2
#> 7  21.4     4  121    109  4.11  2.78  18.6     1     1     4     2

... but the filter "history" can be extracted.

filtered %>% 
  flow::chart()
#> # A tibble: 3 x 3
#>   step                  included excluded
#>   <chr>                    <int>    <int>
#> 1 1974 Motor Trend cars       32       NA
#> 2 mpg >= 20 & mpg <= 30       10       22
#> 3 cyl < 6                      7        3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.