Category R

Beautiful Regression Assumption Plots in R

The performance package in R lets you produce regression assumptions tests and plots. In this video I use the performance package in R to produce a set of beautiful and useful plots to check the assumptions of a linear regression.…

Animating ggplots with gganimate

animated gapminder ggplot

The gganimate package lets you add animation to your ggplots in R. In this video I demonstrate how to recreate animated bubble plots like the site and how to save them as gif files that you can use in…

Play Classic Arcade Games in R with the Rcade Package

Boulderdash in R Studio

The Rcade package lets you play a range of classic video games including Pacman, BoulderDash, and Tetris in RStudio. Check out my video demo and then use the code below to play games yourself. Sign up for my mailing list:

Tetrachoric Correlation

The tetrachoric correlation is a correlation measure for binary variables and is commonly used in psychometrics, particularly for Item Response Theory (IRT). As with other correlation measures, a tetrachoric correlation ranges between -1 and 1, and describes the association between…

How to Search and Filter Text in R

In the video and code below I demonstrate how to use R to search and filter text. For examples I use the Friends package which contains the transcripts of all of the episodes of the Friends TV show. Subscribe below…

How to Plot a Color Coded Map of USA in R

In this video I use the ggplot2 package and the built in USArrests data in R to create a color coded plot of the United States of America. I explain what the various bits of code do and highlight some…

Moving columns in R with relocate

The relocate() function is a simple but very useful function from the Tidyverse. It allows you to move the position with columns within a data frame. I use this most often where I have been delivered data that is not…

Analyzing Cricinfo Cricket Data with R

In the following video I demonstrate how to use the cricketdata package for R to download different types of cricket data from espncricinfo and produce some visualizations.

Arranging plots in R with the patchwork package

The patchwork package in R allows you to customise the arrangement of your graphs. In the following video I work through a number of examples. The code and examples from the video are also provided below for you.