Tips and Tricks
How to create a gauge plot/speedometers in ggplot
January 17, 2024
Gauge plots are a nice way to visualize progress or parts-of-a-whole in general. Due to their round shape, they are sometimes also called speedometer plots. Here’s an example chart. It shows you how much of your goal you have already achieved. Basically, this is a round version of a parts-of-a-whole bar chart. If you want to create one of those, you can check out another one of our blog posts . In this one, we’ll show you how to create the rounded brother. Let’s dive in.The data First, we...
Getting Started with {geomtextpath}
January 3, 2024
Have you ever created a great line graph only to feel frustrated that it requires a messy, hard to read legend? What if you could label the lines directly? Even the curvy ones? And have the text follow the curvature of the lines! With the {geomtextpath} package, you can annotate your ggplot2 visualizations with clean labels and customized text annotations that can follow the shapes in your data, and it’s so much easier to get started than you’d imagine.The Basics First, let’s load our...
R for the Rest of Us 2023 Year in Review
December 20, 2023
It's been quite a year for R for the Rest of Us. With two new courses, updates to three other courses, training work with several organizations, and multiple consulting projects, we've been keeping ourselves busy! Let's share some highlights.New Courses and Updates to Existing Courses 2023 saw the release of two new courses: Making Beautiful Tables with R and Reproducibility for the Rest of Us. Created by Albert Rapp and Jenine Harris, respectively, these courses bring the total number of...
Create Parts-of-a-Whole Bar Charts
December 12, 2023
In our consulting work , we often think about what could be a better visualization for our clients. And sometimes it’s really small tweaks. One example of this is adding a gray background behind bar charts to show percentages as a part of the whole. We did this, for example, in reports about Connecticut housing . To show how to make this in R, let’s start with a bar chart that represents the results of some absolutely fictitious survey. It would be neat if we had another bar on top of each...
Speed up your coding workflow with RStudio hotkeys
November 29, 2023
RStudio is the premier tool to write R code. And just like any tool, the better you know RStudio’s features the faster you can write code. That’s why we decided show you the best hotkeys we use all the time.Don’t type the pipe Whether it is %>% or |> , it is tempting to write out the pipe letter by letter. But the pipe is such an integral part of the tidy workflow that it makes sense to give yourself a tiny speed boost whenever you use the pipe. Just hit ctrl + shift + M to get the job done....
Advanced tricks to put your data into the right format with pivot_longer() and pivot_wider()
November 15, 2023
Last week, we started to learn about pivot_longer() and pivot_wider() . These are two essential functions to speed up you data wrangling process. Check out the video and blog post from last week if you haven’t seen that yet. As promised, this week we’ll continue on this path and learn some of the advanced tricks that these two functions have to offer. This should help you clean your data even faster. Let’s begin by revisiting what we did last week.Taylor Swift again Last week, we worked with...
Put your data into the right format with pivot_longer() and pivot_wider()
November 8, 2023
Conventional wisdom tells us that data wrangling is 90% of all data work. And it’s true. Often, you will have to get your data into the right format before you can get any “real” work done. In the tidyverse, there are two powerful functions to help you with one of the most common data wrangling tasks: going from wide to long and lnog to wide. These functions are pivot_longer() and pivot_wider() . Here, we will cover the standard use case of pivot_*() (we’ll cover more of what they can do next...
Five Steps to Improve Your Chart Quickly
November 1, 2023
Data visualization can be hard. From our experience, it can take hours and hours to perfect a visualization. Thankfully, if you’re stressed for time there are a couple of changes that always work. So let’s check out these evergreen steps we can use to make your chart instantly better.A chart to play with First off, let us create a dummy dataviz with our favorite penguins data set. Once we have that, we can apply little tweaks to make the overall look of our chart better.Use an active title...
Spice up your {gt} table with {ggplot}
October 25, 2023
Have you ever created a table with gt and thought to yourself “Well, maybe just showing the numbers doesn’t cut it? I need to add some visual spice to this table.” If so, then you’re in great company. Because spicing up tables with visuals is one of my favorite tricks. I like to add visual elements like small lines or bars to tables. Apart from making your table pretty, visuals help to convey an overall impression of the data to your reader. So, let me show you how you can add any chart to...