All Projects → daranzolin → Viewpipesteps

daranzolin / Viewpipesteps

Licence: other
Create tabs of View() output for each chained pipe

Programming Languages

r
7636 projects

Labels

Projects that are alternatives of or similar to Viewpipesteps

Votemapswitzerland
A Swiss version of the famous visualization «Land doesn't vote, people do.»
Stars: ✭ 150 (-10.71%)
Mutual labels:  rstats
Tidyversity
🎓 Tidy tools for academics
Stars: ✭ 155 (-7.74%)
Mutual labels:  rstats
Calendr
Ready to print calendars with ggplot2
Stars: ✭ 161 (-4.17%)
Mutual labels:  rstats
Gender
Predict Gender from Names Using Historical Data
Stars: ✭ 149 (-11.31%)
Mutual labels:  rstats
Rentrez
talk with NCBI entrez using R
Stars: ✭ 151 (-10.12%)
Mutual labels:  rstats
Textreuse
Detect text reuse and document similarity
Stars: ✭ 156 (-7.14%)
Mutual labels:  rstats
Shinyalert
🗯️ Easily create pretty popup messages (modals) in Shiny
Stars: ✭ 148 (-11.9%)
Mutual labels:  rstats
Image keras
Building an image classifier using keras
Stars: ✭ 162 (-3.57%)
Mutual labels:  rstats
Supervised Ml Case Studies Course
Supervised machine learning case studies in R! 💫 A free interactive tidymodels course
Stars: ✭ 152 (-9.52%)
Mutual labels:  rstats
Econocharts
Microeconomics/macroeconomics charts in ggplot2
Stars: ✭ 161 (-4.17%)
Mutual labels:  rstats
Vcfr
Tools to work with variant call format files
Stars: ✭ 149 (-11.31%)
Mutual labels:  rstats
Patchwork
The Composer of ggplots
Stars: ✭ 2,002 (+1091.67%)
Mutual labels:  rstats
Vegalite
R ggplot2 "bindings" for Vega-Lite
Stars: ✭ 157 (-6.55%)
Mutual labels:  rstats
G2r
📈 Grammar of graphics for interactive visualisations
Stars: ✭ 150 (-10.71%)
Mutual labels:  rstats
Tokenizers
Fast, Consistent Tokenization of Natural Language Text
Stars: ✭ 161 (-4.17%)
Mutual labels:  rstats
Pins
Pin, Discover and Share Resources
Stars: ✭ 149 (-11.31%)
Mutual labels:  rstats
Decryptr
An extensible API for breaking captchas
Stars: ✭ 154 (-8.33%)
Mutual labels:  rstats
Plotly
An interactive graphing library for R
Stars: ✭ 2,096 (+1147.62%)
Mutual labels:  rstats
Writexl
Portable, light-weight data frame to xlsx exporter for R
Stars: ✭ 162 (-3.57%)
Mutual labels:  rstats
Ghactions
GitHub actions for R and accompanying R package
Stars: ✭ 159 (-5.36%)
Mutual labels:  rstats

ViewPipeSteps

ViewPipeSteps helps to debug pipe chains in a slightly more elegant fashion. Print/View debugging isn’t sexy, but instead of manually inserting %>% View() after each step, spice it up a bit by, e.g., highlighting the entire chain and calling the viewPipeChain addin:

The View Pipe Chain Steps RStudio addin

Thanks to @batpigandme for the the gif!

Alternatively, you can:

  • Print each pipe step of the selction to the console by using the printPipeChain addin.
  • Print all pipe steps to the console by adding a print_pipe_steps() call to your pipe.
diamonds %>%
  select(carat, cut, color, clarity, price) %>%
  group_by(color) %>%
  summarise(n = n(), price = mean(price)) %>%
  arrange(desc(color)) %>%
  print_pipe_steps() -> result
## 1. diamonds

## # A tibble: 53,940 x 10
##    carat cut       color clarity depth table price     x     y     z
##    <dbl> <ord>     <ord> <ord>   <dbl> <dbl> <int> <dbl> <dbl> <dbl>
##  1 0.23  Ideal     E     SI2      61.5    55   326  3.95  3.98  2.43
##  2 0.21  Premium   E     SI1      59.8    61   326  3.89  3.84  2.31
##  3 0.23  Good      E     VS1      56.9    65   327  4.05  4.07  2.31
##  4 0.290 Premium   I     VS2      62.4    58   334  4.2   4.23  2.63
##  5 0.31  Good      J     SI2      63.3    58   335  4.34  4.35  2.75
##  6 0.24  Very Good J     VVS2     62.8    57   336  3.94  3.96  2.48
##  7 0.24  Very Good I     VVS1     62.3    57   336  3.95  3.98  2.47
##  8 0.26  Very Good H     SI1      61.9    55   337  4.07  4.11  2.53
##  9 0.22  Fair      E     VS2      65.1    61   337  3.87  3.78  2.49
## 10 0.23  Very Good H     VS1      59.4    61   338  4     4.05  2.39
## # … with 53,930 more rows

## 2. select(carat, cut, color, clarity, price)

## # A tibble: 53,940 x 5
##    carat cut       color clarity price
##    <dbl> <ord>     <ord> <ord>   <int>
##  1 0.23  Ideal     E     SI2       326
##  2 0.21  Premium   E     SI1       326
##  3 0.23  Good      E     VS1       327
##  4 0.290 Premium   I     VS2       334
##  5 0.31  Good      J     SI2       335
##  6 0.24  Very Good J     VVS2      336
##  7 0.24  Very Good I     VVS1      336
##  8 0.26  Very Good H     SI1       337
##  9 0.22  Fair      E     VS2       337
## 10 0.23  Very Good H     VS1       338
## # … with 53,930 more rows

## 4. summarise(n = n(), price = mean(price))

## # A tibble: 7 x 3
##   color     n price
##   <ord> <int> <dbl>
## 1 D      6775 3170.
## 2 E      9797 3077.
## 3 F      9542 3725.
## 4 G     11292 3999.
## 5 H      8304 4487.
## 6 I      5422 5092.
## 7 J      2808 5324.

## 5. arrange(desc(color))

## # A tibble: 7 x 3
##   color     n price
##   <ord> <int> <dbl>
## 1 J      2808 5324.
## 2 I      5422 5092.
## 3 H      8304 4487.
## 4 G     11292 3999.
## 5 F      9542 3725.
## 6 E      9797 3077.
## 7 D      6775 3170.
  • Try your luck with the experimental %P>% pipe variant that prints the output of the pipe’s left hand side prior to piping it to the right hand side.
diamonds %>%
  select(carat, cut, color, clarity, price) %>%
  group_by(color) %>%
  summarise(n = n(), price = mean(price)) %P>%
  arrange(desc(color)) -> result
## Printing diamonds %>% select(carat, cut, color, clarity, price) %>% group_by(color) %>% summarise(n = n(), price = mean(price))

## # A tibble: 7 x 3
##   color     n price
##   <ord> <int> <dbl>
## 1 D      6775 3170.
## 2 E      9797 3077.
## 3 F      9542 3725.
## 4 G     11292 3999.
## 5 H      8304 4487.
## 6 I      5422 5092.
## 7 J      2808 5324.

Installation

devtools::install_github("daranzolin/ViewPipeSteps")

More Examples

Check tools/test_cases.R for more elaborate examples.

Future Work

  • Verify that %P>% is implemented in a useful way and does it what it is supposed to do.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].