Get access to all lessons in this course.
-
Welcome to Data Cleaning with R
- What is Data Cleaning?
- Course Logistics and Materials
-
Data Organization
- Data Organization Best Practices
- Tidy Data
- Grouping and Indicator Variables
- NA and Empty Values
- Data Sharing Best Practices
-
Restructuring Data
- Tidyverse Refresher
- Working with Columns with across()
- Pivoting Data
- coalesce() and fill()
-
Regular Expressions
- What are Regular Expressions?
- Understanding and Testing Regular Expressions
- Literal Characters and Metacharacters
- Metacharacters: Quantifiers
- Metacharacters: Alternation, Special Sequences, and Escapes
- Combining Metacharacters
- Regex in R
- Regular Expressions and Data Cleaning, Part 1
- Regular Expressions and Data Cleaning, Part 2
-
Common Issues
- Common Issues in Data Cleaning
- Unusable Variable Names
- Whitespace
- Letter Case
- Missing, Implicit, or Misplaced Grouping Variables
- Compound Values
- Duplicated Values
- Broken Values
- Empty Rows and Columns
- Parsing Numbers
- Putting Everything Together
Data Cleaning with R
Working with Columns with across()
This lesson is locked
This lesson is called Working with Columns with across(), part of the Data Cleaning with R course. This lesson is called Working with Columns with across(), part of the Data Cleaning with R course.
If the video is not playing correctly, you can watch it in a new window
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.
You need to be signed-in to comment on this post. Login.
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 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.