Skip to content
What's New in R is a weekly email to help you up your R game. Sign up →
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 a Thousand Plots Look Good: Data Viz Tips for Parameterized Reporting

September 26, 2024

In June 2024, I gave a talk at Cascadia R Conference about making high-quality data viz when doing parameterized reporting . It's something we do a lot in our consulting work . I recorded myself prepping for the talk, which you can see here. If you want to see a recording of the talk given at the conference, check out the Cascadia R Conf YouTube page . Slides Talk Abstract Data visualization is complicated enough when you are making one plot. Now imagine you're making multiple plots in...

Data viz tips for parameterized reporting: set consistent axis limits

August 1, 2024

One of the biggest challenges we face when doing parameterized is how to make plots consistent across multiple reports. We’ve learned (oftentimes the hard way) many tricks for dealing with this problem. One I want to share with you today is making your axis limits consistent when making multiple plots. Here’s an example of a plot that shows median income by county for the annual Oregon by the Numbers . Let me show you a simplified version of the function I created to make these plots. We’ll...

How to make polished population pyramids in ggplot: part 2

July 18, 2024

I wrote recently about how I revamped the process of making population pyramids for Oregon by the Numbers , the report I’ve worked on for the last several years. Rather than making one plot, I used the patchwork package to stitch together three parts: A plot for women on the left Age labels in the center A plot for men on the right The result is a polished version of a population pyramid that I’m quite pleased with. The blog post I wrote about making this version of the population pyramid saw...

Animated versions of common dplyr functions

July 17, 2024

One of the best parts about the functions in the dplyr package (one of several that make up the tidyverse collection of packages) is that their names indicate what they do. No need to remember a weird acronym; the name of the function to filter your data is filter() . But, helpful as these function names are, it can still be hard to remember exactly what the functions do. In remaking my Fundamentals of R course in 2023, I had Albert Rapp generate animated versions of the most common...

What's New in R

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

What’s New in R: October 14, 2024

October 14, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a package for tidy country-level data, insights from the UK COVID-19 dashboard team, and a guide on using iteration in R for reproducible data science. Let’s dive in! {tidycountries} This package (hat tip to R Weekly ) provides a nice collection of county-level data. Best of all, developer Dennis Irorere has set it up to return data in a tidy format, making it ready for analysis, visualization, etc. Read More →...

What’s New in R: October 7, 2024

October 7, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a utility package for enhancing {gt} tables, a tutorial on extracting metadata from filenames, and an update to the popular {patchwork} package for combining plots. Let’s dive in! {gtUtils} This new package by Andrew Weatherman provides a set of additional themes and functions for the {gt} package. With it, you can make your tables look like those made by the English Premier League , tweak formatting using...

What’s New in R: September 30, 2024

September 30, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a round-up of data viz packages, a collection of time series datasets, and a tutorial on reading web-based files directly into R. Let’s dive in! The best R packages for data visualization R is well known for being an amazing tool for data viz. The sheer number of data viz packages is one reason why. This is an opinionated round-up of some of the top packages for data viz in R. No matter whether you agree or...

What’s New in R: September 23, 2024

September 23, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a book on data viz in R, a video on using the {renv} package for reproducible environments, and an in-depth tutorial on the theme() function. Let’s dive in! Modern Data Visualization with R This book, released earlier this year, is a great introduction to making data viz in R. It’s also a great reference, with chapters showing how to make different types of charts, maps, and more. Read More → December 2023...

R in 2 Minutes

Short videos highlighting useful R packages and functions.

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

How to preview plots at specific dimensions in RStudio

September 12, 2024

If you've ever saved plots made in ggplot to a file, you've probably noticed that the dimensions of your plots you saw in RStudio does not correspond to their dimensions outside of RStudio. I recently learned a tip from Nicola Rennie for how to deal with this. Using the ggrecord() function from the camcorder package, you can preview plots in RStudio so that they have the exact same dimensions as when you save them with ggsave() . Code shown in video

How to wrap text automatically in ggplot

August 15, 2024

If you've ever spent time in ggplot trying to get the width of text elements just right, this tip is for you! I recently learned from Nicola Rennie about the element_textbox_simple() function from the ggtext package. This function will automatically wrap your title, subtitle, or other text so that it fits perfectly with your plot. Code shown in video

Podcast

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

R for the Rest of Us Podcast Episode 19: Crystal Lewis

October 10, 2024

In this episode, I chat with Crystal Lewis about data management and her book titled ‘ Data Management in Large-Scale Education Research ’. Crystal, a freelance research data management consultant, shares insights on good planning and systematic implementation of practices that are key to effective data management. She discusses the importance of automated data validation, and outlines a structured approach to data cleaning. Additionally, Crystal reflects on her experience writing an...

R for the Rest of Us Podcast Episode 18: Miles McBain

August 29, 2024

In this episode, I speak with Miles McBain, a data scientist and R package developer from Brisbane, Australia, about patterns and anti-patterns in data analysis reuse. Miles shares his journey from a generalist software developer to a data science specialist, his passion for R, and the evolution of his coding practices. We delve into the intricacies of code reuse in data analysis, discussing common pitfalls to avoid, the benefits of creating reusable code packages, the process of breaking...

R for the Rest of Us Podcast Episode 17: Meghan Harris

July 25, 2024

In this episode, I speak with Meghan Harris, a data scientist at the Prostate Cancer Trials Consortium at the Memorial Sloan Kettering Cancer Center. Meghan is one of the special people who do generative art in R. She talks about why she likes making generative art in R and how it has helped her improve her R skills in other areas. Listen to the Audio Version Watch the Video Version You can also watch the conversation on YouTube. In the video version, Meghan gives a walkthrough of how to make...

R for the Rest of Us Podcast Episode 16: Cara Thompson

June 13, 2024

In this episode, I speak with Cara Thompson about color, delving into several aspects of its use in data visualization. Cara is a UK-based data visualization consultant with over 15 years of experience in transforming data insights into clear, compelling visual stories. We explore how she finds inspiration for selecting colors, her reasons for not simply using organizations' brand colors in her visualizations, and the importance of dedicating time to thoughtfully consider color choices in...