Publications by R | TypeThePipe
Shadowing your ggplot lines. Forecasting confidence interval use case.
Yesterday I was asked to easily plot confidence intervals at ggplot2 chart. Then I came up with this shadowing ggplot2 feature called geom_ribbon(). It’s not a trivial issue as long as you need to gather your data in order to achieve a tidy format. When you already have this data frame, all you need is geom_ribbon(). By using the following comm...
1016 sym R (698 sym/2 pcs) 4 img
Reordering bars in GGanimate visualization
Last week several gganimate visualizations came to my feed. Some R users were wondering about reordering gganimate and ggplot2 bars as long as them are evolving (over animation time). Then, we came up with this R viz where several bars are not only evolving and reordering over time but leaving and joining the chart. We want the top 4 countries ov...
964 sym R (1092 sym/1 pcs) 2 img
Skills chart using Gplot2 with R
In this TypeThePipe tip we are bringing you a skills plot template using R and ggplot2. Maybe its a good idea to evolve this plot and add an unique skill plot to your CV. And it’s only a few lines of R code! You can see the code below 🙂 library(ggplot2) # library(plotly) library(tibble) library(dplyr) skills <- tribble( ~ Skill, ~ Hours, ~...
684 sym R (912 sym/1 pcs) 2 img
Using summarise_at(). Weighted mean Tidyverse approach
Supose you are analysing survey data. You are asked to get the mean in a representative way, weighting your individuals depending on the number of members of their segment. library(tidyverse) survey_data <- tribble( ~id, ~region1, ~region2, ~gender, ~q1, ~q2, 1,"sp","mad","m", 2,5, 2,"it", "bol", "m", 5, 10, 3,"sp", "bar", "f", 2, 2, 4,"sp"...
572 sym R (414 sym/1 pcs) 1 tbl
Tidylog
Some time ago I made one of the best discoveries I have ever made in the Tidyverse: a tool called tidylog. This package is built on top of dplyr and tidyr and provides us with feedback on the results of the operations. Actually, this is a feature that already appeared in the Stata software. When performing one operation at a time, it is easy to t...
2072 sym R (1012 sym/1 pcs)
Tidylog. Logging your pipelines
Some time ago I made one of the best discoveries I have ever made in the Tidyverse: a tool called tidylog. This package is built on top of dplyr and tidyr and provides us with feedback on the results of the operations. Actually, this is a feature that already appeared in the Stata software. When performing one operation at a time, it is easy to t...
2072 sym R (1012 sym/1 pcs)
Pathfinding Algorithms Visualizer using R! (I) Setting up the interactive grid
Here you can find the R code. It’s an ‘in progress’ script. I will develop basic features like: ploting/rendering code refactoring; GGanimate with the algortihm steps moving forward; and, of course, several pathfinding algorithms and evolutionary ones. All these features and much more in following posts! Stay tuned! Below you can find th...
1022 sym R (4869 sym/2 pcs) 2 img
Drop columns based on NAs percentage in R
Are you developing an automated exploration tool? Here we propose some alternatives to drop columns with high percentage of NAs. In this previous tip we talk about BaseR vs Tidy & Purrr counting NAs performance. Not leaving the pipeflow. How much does it cost?;) It depends on the NA distribution between features and its number, but not much that ...
820 sym R (264 sym/1 pcs) 2 img
Speed up your R scripts. A cool optimized way to load, write and store big data frames with FST package!
Are you trying to save and load your DL model or a big dataset in R? Here we show you a performance boost to your scripts and reduction in disk memory storage with the FST CRAN package. We are going to benchmark it with R base functions (csv and RDS extensions) and another great package like readr: library(tidyverse) big_dataset %>% nrow() # 700k...
1185 sym R (974 sym/1 pcs) 2 img
Playing with a new R package; Welcome ggcharts!
Yesterday I was playing with the new and first Thomas Neitman’s CRAN package! Its documentation reminded me that more than a year ago Type The Pipe did a talk series about text mining. In one of them, we analized the reviews of the most important spanish banking APPs. One of the first plots was a lollipop chart showing the ratings in the Play S...
1666 sym R (2394 sym/6 pcs) 6 img