Skip to content
R for the Rest of Us Logo

R in 2 Minutes

Short videos highlighting useful R packages and functions.

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

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.

How to use RStudio's autocomplete feature to easily import data

July 2, 2024

Have you ever started writing code to import data, only to forget what the file you want to import is called? You've got to go find the file, remember its name, and then put into your code. There's a quicker way! In this video, I show how to use RStudio's autocomplete function in order to easily import your data.

Make your code output easier to see in RStudio

June 20, 2024

When I live code, it's often the little things that I do that people are most interested in. I was recently doing some live coding and someone asked how I changed where the output of my code showed up when working in a Quarto document. Here's a short video to show you how to change your code chunk output to show up in your console when working in RStudio.

R doesn't round the way you think it does

May 30, 2024

I can't tell you how much time I've spent thinking about rounding in R. Rounding, you ask? Yep! Rounding in R can be confusing because the way R rounds numbers is different than what you might expect. Here's how it works!

How to install a package not on CRAN

May 1, 2024

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.

How to Use the Scales Package in R for European-style Number Formatting

April 3, 2024

Hello, my European friends! Ever read the number 123.45 (formatted in the American style where the period is the decimal point) and wish you could easily convert this to a European-style 123,45 (where the comma is the decimal point). You can! In this R in 2 Minutes video, I show you how to use the scales package in R for European-style number formatting.