Skip to content
R for the Rest of Us Logo

R in 2 Minutes

Short videos highlighting useful R packages and functions.

Learn to make an R package in less than 2 minutes

April 17, 2025

Have you ever wanted to create your own R package but thought it was too complicated? I used to think the same thing! But I recently learned how to create a simple theme package in R, and I want to show you just how easy it can be. So easy that I can demonstrate the process in just two minutes! In this quick video, I walk you through the step-by-step process of creating your own R package. Here's what I cover: Creating a new package project in RStudio Setting up the package structure using...

Use the {beepr} package to be notified when your R code is done

March 27, 2025

Tired of waiting for your R script to finish running? In my latest "R in 2 Minutes" video, I showcase the {beepr} package, which plays a sound when your code is complete, so you don’t have to keep checking! I demonstrate how it works using a time-consuming task—importing multiple CSV files—and explore various fun sound options, including nostalgic ones. Plus, my son Elias joins as a special guest, adding some comic relief while we wait. This simple trick can save time and make your R coding...

How to use the add_row() function in R

March 6, 2025

Ever needed to quickly add just one row of data to your dataset in R? Maybe you forgot an entry or want to add something new? I recently ran into this exact situation while making a chart with my son showing the highest soccer goal scorers of all time. He wanted to add himself to the list (dreaming big, right?). In this quick video, I show you how to use the add_row() function from the tidyverse to easily add a single row of data to your existing dataset. It's super straightforward - you just...

How to read in hundreds of CSV files with one line of code

February 13, 2025

Ever found yourself staring at a folder full of CSV files, wondering how on earth you're going to import them all without writing a ton of code? I've been there! I used to think I needed some complex solution, but it turns out you can do it with just one line of code. In this quick video, I show you how to: Use the {fs} package along with the tidyverse Create a vector of all your CSV files in a directory Import them all at once using read_csv() (not read.csv()!) The best part? This method...

How to generate QR codes in R

January 23, 2025

Ever given a presentation and wanted an easy way for people to access your materials afterwards? I recently discovered a neat solution: adding QR codes to slides! In my recent posit::conf() talk, I used QR codes to help people quickly access my slides, GitHub repo, and website – no need for anyone to frantically type in long URLs. I've made a quick R in 2 Minutes video showing how to use the qrcode package in R to automatically generate these QR codes. Here's what I cover: Using the qr_code()...

Use the view() function to quickly look at your data in R

December 5, 2024

Ever want to take a quick look at your data? In my R in 2 Minutes video, I show how to use the view() function to quickly display data in a separate window. I explain why it's useful at the end of pipelines and how to combine it with functions like filter() . It’s a simple trick that can save time and prevent headaches when working with data in R.

Make all of your plots made in ggplot use consistent fonts

October 31, 2024

Have you ever struggled with keeping fonts consistent across all your data visualizations? It's a common headache, but I've got a solution that'll make your life easier! In my latest blog post, I dive into a couple of little tricks using ggplot2 that'll help you maintain font consistency without having to manually adjust each plot. Here's what I cover: Using the theme_set() function to apply a consistent theme across all your plots Leveraging update_geom_defaults() to set default font...

How to update all of your R packages

October 3, 2024

There are times when working in R that you'll want to update not just one package, but all packages you currently have installed. There are many ways to do this, but I recently saw a tip from Kurt Birson that was so good, I had to make a video to demonstrate it. In the latest R in 2 Minutes video, I show you how to update all of your R packages with just a few lines of code. Here's the code I used in the video:

How to distinguish overlapping points in ggplot

September 19, 2024

Ever made a plot in ggplot where you've got two points that are close together? It can be hard to distinguish them. I've figured out a really nice simple way to make sure all of your points are visible. Code shown in video