Skip to content
R in 3 Months Starts March 13. Learn More →
R for the Rest of Us Logo

Data Cleaning with R

Working with Columns with across()

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

  • Load the midwest data bundled with ggplot2

  • Keep only rows for Ohio (OH)

  • Subset the ‘county’ column and all columns that match the string ‘pop‘ (hint: use a selection helper)

  • Square-root transform all numeric variables

Learn More

The tidyverse blog announcing dplyr 1.0 had a nice overview of the across() function.

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

FELIPE SANCHEZ NAJERA

FELIPE SANCHEZ NAJERA • October 11, 2023

Hi! I just wanted to ask why the professor mutates the numeric variables into a log scale; what is the purpose or usefulness of this transformation instead of using the non-mutated data?

David Keyes

David Keyes Founder • October 11, 2023

I don't think the transformation really matters here. It's just a toy example in order to demonstrate how to work across multiple variables.