Skip to content
R for the Rest of Us Logo

R in 2 Minutes

Short videos highlighting useful R packages and functions.

How to add speaker notes to Quarto slides

June 26, 2025

Have you ever been presenting slides and wished you had some hidden notes to help guide you through your presentation? There is a super helpful feature in Quarto that lets you add speaker notes to your slides - and your audience will never see them! In this quick video, I show you how to: Add speaker notes to your Quarto slides Access your notes during presentations Keep your notes on a second screen This has been a game-changer for me when teaching R in 3 Months sessions. I can keep track of...

How to conditionally execute code chunks in Quarto

June 5, 2025

Ever had a Quarto document where some code works perfectly in HTML but looks awful in Word (or vice versa)? I just ran into this problem with tables -{gt} tables look great in HTML but not so hot in Word, while {flextable} works beautifully in Word format. In this quick video, I show you a neat trick for conditionally executing code in Quarto. This is super handy when you're creating documents that need to be exported to multiple formats. No more manually commenting out code or creating...

How to add patterns to your plots with {ggpattern}

May 15, 2025

Ever wanted to add patterns to your plots made with ggplot? You can with the {ggpattern} package! Check out this short intro to the package. If you want to go deeper on {ggpattern}, check out its documentation website for all of the details about how it works. Code used:

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.