Skip to content
R for the Rest of Us Logo

R for the Rest of Us Blog

How to Make 250+ Plots at the Same Time with R

For the past several years, I've worked on a report called Oregon by the Numbers . In this project, I use R to make every single plot in the report: over 250 plots each year. In the time I've worked on this project, I've become more and more efficient at making these plots. My efficiency comes thanks to the walk() function from the purrr package. This function can be confusing, but if you learn how to use it, you too can make hundreds of plots in just a few lines of code. As you'll see in the...

R for the Rest of Us Podcast Episode 4: Abdoul Madjid

In this episode I speak with Abdoul Madjid about his journey to R. Listen to the Audio Version Watch the Video Version You can also watch the conversation on YouTube . The video version has a walkthrough of how he made his COVID-19 map using R. To learn more about Abdoul, you can find him on Twitter and on Mastodon . His data visualization, done as part of Tidy Tuesday , is on GitHub . Learn More If you want to receive emails to help you on your R Journey, sign up for the R for the Rest of Us...

R for the Rest of Us Podcast Episode 3: Tom Mock

In this episode, I speak with Tom Mock. Tom works at Posit (formerly RStudio) where he helped customers use that company's suite of products. Tom also loves building tables. I spoke with Tom about how he learned R, how he uses it today, and why he is so into making tables in R. Listen to the Audio Version Watch the Video Version You can also watch the conversation on YouTube . The video version has a code walkthrough of how to make high-quality tables in R with the {gt} package. You can find...

Using ChatGPT to Create Data Visualization with ggplot

Have you heard about ChatGPT ? It's the latest in a line of AI tools that may transform how we write and how we code. ChatGPT takes a question and returns an answer. And it does so in a very human-sounding way . You know Siri? It's kind of like that, but actually good. To test it out, I signed up on the ChatGPT website and entered this prompt: Create a plot using ggplot2 and the palmerpenguins package . What I got back was very impressive. The response, copied verbatim below, shows exactly...

No Designer Needed: How to Create Beautiful Reports Using Only R

I recently gave a talk titled No Designer Needed: How to Create Beautiful Reports Using Only R at the CANSSI Ontario Statistical Software Conference . This talk showed how we at R for the Rest of Us use the pagedownpackage to make high-quality PDF reports for our clients . In the talk, I explained the two approaches people typically take when making PDFs: Some people make all charts and tables, and then bring in a designer to lay out the report. The problem with this is that it is...

R for the Rest of Us Podcast Episode 2: Nassos Stylianou and Clara Guibourg

In 2017, BBC data journalist Nassos Stylianou was working with a backend developer on a particularly large data set. Nassos was primarily an Excel user at the time, but this data was too large for Excel. Seeing the developer work through the data with ease, a light bulb went off for Stylianou: if he and his data journalism team learned to use R, they could do this type of analysis on their own. This realization began a journey into R. This journey, which started with needing to analyze data...

Why You Should Always Use RStudio Projects

One of the most important tips we teach participants in R in 3 Months is to always use RStudio projects. There are a lot of resources out there that explain why this is useful (see, especially, Jenny Bryan's article Project-Oriented Workflow ). But many of these resources go a bit over the head of newcomers. So, I asked Charlie Hadley to record a video explaining why using RStudio projects is so important. In her video below, you'll see a clear, concise, and simple explanation for the value...

How to Read R Help Pages

Folks just starting out with R often assume that those of us who are more experienced never need to get help. This is definitely not true! Everyone always searches for help, no matter how advanced an R user you are. Learning how to search for help when you need it is a key skill. One of the places user typically look for help is in the help files that are loaded when you type ?function() (replacing function() with an actual function name, of course). These help files have a particular format...

Automating Sentences with R

The thing that first drew me to R was the ability to run the same analysis on different datasets and get a similar output every time: the same graphs, the same analyses, the same structure to the report, but different data, so a different story to tell. We often talk about the power of R in making research analyses reproducible , or in generating parameterized reports which all include variants of the same graphs, but one thing we haven't talked much about is the role R can play in automating...

How to Make a Donut Chart in ggplot

A lot of data visualizations are designed to show multiple data points (think bar charts that compare results for multiple groups). But what if you want to show just one data point? Say, for example, you want to show what percentage of people have accomplished something? There are two techniques we often use in our consulting work to show single data points: Donut charts : These are pie charts with a hole in the middle (hence, donuts). Pie charts with multiple slices are problematic (people...