Skip to content
R for the Rest of Us Logo

R for the Rest of Us Blog

How to remove unwanted texts in your data

Text cleaning is a common part of data analysis. You may not really want to do it but it’s often necessary. For example, have a look at this data set from tidyTuesday. It shows you the stock prices of some big tech companies. Maybe you want to work only with this financial data set. But at some point you will probably have to communicate your findings to someone else. And if these people are anything like me, then they probably don’t immediately know which company is meant by a symbol like...

What’s New in R: May 20, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring an in-progress update to Modern Data Science with R, a tutorial on using flags for facetted plots, and a deep dive into avoiding overplotting. Let’s dive in! Modern Data Science with R This book, written by Benjamin S. Baumer, Daniel T. Kaplan, and Nicholas J. Horton, bills itself as “a comprehensive data science textbook for undergraduates that incorporates statistical and computational thinking to solve...

R for the Rest of Us Podcast Episode 15: Nicola Rennie

In this episode, I talk with Nicola Rennie about making data viz for mobile devices. Nicola is a lecturer in health data science based within the Center for Health Informatics, Computing, and Statistics at Lancaster University in the UK. She recounts her initial encounter with R and how she got deeper into data visualization in R as a means of creative expression. Amidst the plethora of programming languages available, Nicola sheds light on why she chose R specifically for data visualization....

What’s New in R: May 13, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a Quarto extension to show when your document was most recently updated, animations of common functions, and a video to show you how to efficiently import hundreds of Excel files to R. Let’s dive in! Add last rendered or modified time to Quarto Say you’re working on an analysis in a Quarto document and you want to add a timestamp to show when it was last updated. How would you do this? You could write some code,...

Use shadowtext to add outlines to your texts

As probably most of you know, the premier package to create charts in the tidyverse is ggplot2 . On its own, this package is already incredibly powerful. It really cannot be stressed enough that you can create impressive charts with just this one package. Still, there are some things that ggplot cannot do on its own. And one such thing is adding outline strokes to texts like this: See that black outline around the text? That’s the work of an extra package called shadowtext . On it’s own...

What’s New in R: May 6, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring not one, not two, but three data viz guides. Let’s dive in! UK Royal Statistical Society best practices for data visualization guide Released in July 2023, the UK Royal Statistical Society guide, Best Practices for Data Visualization, is a great resource to have on hand. Written by Andreas Krause, Nicola Rennie, and Brian Tarran, the guide has general guidance as well as code samples to help you make better data...

How to install a package not on CRAN

Ever tried to install an R package using install.packages() and had it not work? It's very frustrating! Fortunately, there are ways around this. In this video, I show how to install R packages that are not on CRAN.

What’s New in R: April 29, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a tutorial on making a beautiful snow cover map, a walkthrough of approaches to making custom arrows in ggplot, and some food for thought on making your data analysis even more reproducible than it probably is today. Let’s dive in! Origin and development of a Snowflake Map We may be moving out of snow season, but if you’re down to explore a map showing snow cover in the United States, this blog post is for you!...

Use snippets in RStudio to repeat common patterns

Sometimes it’s the little things that can give you a productivity speed boost. That’s why we’ve already looked into great RStudio keyboard shortcuts that can make your programming life easier. In today’s blog post, we want to highlight another one of RStudio’s excellent features, namely reusuable code snippets. For example, check out this function: Here, I’ve created a simple function that adds two vectors. There are two ways to create this: Write this all out (including all of the special...

What’s New in R: April 22, 2024

Welcome to this week’s edition of ​What’s New in R ​! This week, we’re featuring a tutorial on wrapping text labels, a comprehensive look at joins, and an analysis of toast (yes, really). Let’s dive in! How to wrap long strip labels in facet_wrap If you’ve ever made a facetted plot in ggplot and found that the title of each plot (fancy name: strip text) is too long and gets cut off, this blog post from the website Data Viz with Python and R is for you! It shows how to use the labeller...