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
Tidyverse Refresher
This lesson is locked
This lesson is called Tidyverse Refresher, part of the Data Cleaning with R course. This lesson is called Tidyverse Refresher, part of the Data Cleaning with R course.
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
Create a new R script file. Within it, do the following:
Load the mammal sleep data bundled with
ggplot2
Select “name” and “conservation” columns and those that include the string ‘sleep’ in their name
Create a new column that contains the values of ‘sleep_total’ multiplied by 3
Filter the data to remove domesticated mammals
Use pipes to chain the operations!
Learn More
If you're interested in learning more about the Tidyverse approach, see this article on R for the Rest of Us website. This lesson from Adam Sullivan provides an overview of data chaining. And the University of Toronto Coders Club has a nice overview of how the pipe works.
You need to be signed-in to comment on this post. Login.