Skip to content
R for the Rest of Us Logo

Blog

Learn to use the most powerful tool for working with data.
Even if you've never coded before.

How to make heatmaps in ggplot

May 1, 2025

Heatmaps are a common way of representing data. In this blog post, I'll show you how to make your own heatmaps using ggplot. In the process, you'll learn a bit about working with the {sf} package, specifically the st_make_grid() function to make a grid, the st_intersection() function to clip the boundaries of your geography to the grid you create, and st_join() to do spatial joins. This blog post is adapted from a lesson in the Mapping with R course . If you want to learn to make heatmaps...

Use shadows in ggplot to highlight findings

April 24, 2025

In our consulting work, we make a lot of the data visualization for parameterized reporting . It’s something I spoke about in my 2024 Cascadia R Conf talk, How to Make a Thousand Plots Look Good: Data Viz Tips for Parameterized Reporting . One example I gave in this talk came from our work with the Johns Hopkins International Vaccine Access Center and the World Health Organization . In this project, we made reports for the Immunization Agenda 2030 project, which tracks the progress countries...

Create your own custom {ggplot2} theme

April 3, 2025

Creating custom themes in {ggplot2} lets you elevate your data visualizations from standard to standout. Whether you’re aiming for a polished, brand-consistent look for your organization or a unique aesthetic that reflects your personal style, a custom theme function makes it easy to apply your design to all figures with a single line of code. In this tutorial, we’ll cover: the essentials of the powerful ggplot2::theme() function, including how to adjust fonts, colors, sizing, and spacing;...

Hide text labels with small values to make charts made in ggplot easier to read

March 13, 2025

One issue that we often face when making data visualization in reports is text not fitting into graphs. This happened to us when working on reports for the Connecticut Data Collaborative and the Partnership for Strong Communities in Connecticut. The reports we made , which show key demographic and housing indicators for towns and counties across the state, have bar charts that show the housing cost burden for renters and home owners in the state. In addition to the categories severe burden...

What's New in R

A weekly roundup of new resources in the world of R.

What’s New in R: July 14, 2025

July 14, 2025

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a visualization guide using tidycensus, a collection of the latest updates in using AI with R, and new podcast with a very prominent guest. Let’s dive in! Visualizing Census Data with tidycensus In a recent blog post, the USGS Water Data team provides a comprehensive guide on how to use the tidycensus package for visualizing U.S. Census data. This tutorial walks you through the process of acquiring and plotting...

What’s New in R: July 7, 2025

July 7, 2025

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring an overview of how the {gex} package works, a collection of resources for R users, and an exploration of computer vision with LLMs in R. Let’s dive in! Dependency-light hex stickers with {gex} In this blog post, Matt Dray lays out how his package {gex} works. This package, which makes hex stickers for packages, may not be something you need to use. But the blog post walks through image manipulation in R using the...

What’s New in R: June 30, 2025

June 30, 2025

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring ggplot becoming an adult, a critique of vibe coding in scientific research, and updates to a tool for automatically formatting your R code. Let’s dive in! ggplot turns 18 The famous package for data viz, {ggplot2}, recently turned 18. It’s hard to overstate the impact it has had. If you want to know more about its impact, this QZ article from a few years ago is a great place to start . Read More → Vibe coding...

What’s New in R: June 23, 2025

June 23, 2025

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring exciting developments in AI for R users, a deep dive into LA County’s population trends, and a guide to using renv in R. Let’s dive in! Lots Happening in the LLM/R Space In this LinkedIn post, Veerle Van Leemput shares insights into the latest developments in AI for R users. It’s got a roundup of some packages to help you use large language models in your work. Read More → Los Angeles County Population In this...

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...

Podcast

Conversations with users around the world about interesting things they are doing with R.

R for the Rest of Us Podcast Episode 28: Nick Tierney

July 10, 2025

Our latest R for the Rest of Us podcast episode features Nick Tierney—a statistician, R developer, and consultant whose career journey spans academic research, software engineering, and more. In this episode, we talk about Nick’s journey with R, his influential blog Credibly Curious , and how he built {naniar}—an R package designed to make working with missing data easier. Nick also discusses: Why writing tests for R packages is essential (and easier than you might think) His philosophy on...

R for the Rest of Us Podcast Episode 27: Garrick Aden-Buie

June 12, 2025

In Episode 27 of R for the Rest of Us , we sit down with Garrick Aden-Buie, a senior software engineer at Posit (formerly RStudio), to explore his latest project: brand.yml . This innovative tool aims to simplify and unify branding across various data science outputs, including Quarto documents, Shiny apps, and more. Garrick shares the inspiration behind brand.yml, stemming from his experiences in creating custom theming solutions at different organizations. Recognizing the repetitive nature...

R for the Rest of Us Podcast Episode 26: Deepali Kank

May 8, 2025

In this episode of R for the Rest of Us podcast, I chat with Deepali Kank, a talented R user and data visualization expert. Deepali shares her journey from creating static visualizations in ggplot2 to building interactive charts using Observable Plot, a JavaScript-based tool. We dive into her recent projects, explore how Observable makes it easy to add interactivity, and talk about how it compares with tools like Shiny and Quarto dashboards. If you're curious about expanding your data viz...

R for the Rest of Us Podcast Episode 25: Robert Smith

March 20, 2025

In this episode, I chat with Robert Smith, a health economist and co-founder of Dark Peak Analytics. Rob shares his unique career path from academia to advising the UK government during the COVID-19 pandemic, where he helped shape public health decisions through data modeling. We also discuss his work with Parkrun, a free community running event, and how data science can be used to promote equitable access to fitness. Using R, Rob and his team analyzed participation trends and developed...