This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Empty rows and columns - your turn #### | |
# # | |
## %######################################################%## | |
# Import the Marine Protected Areas dataset (MPAS-your.csv) | |
# Identify the empty rows and columns, and create a new object with only the empty rows and columns | |
# Remove the empty rows and columns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Parsing numbers - your turn #### | |
# # | |
## %######################################################%## | |
# Import the Marine Protected Areas dataset (MPAS-mine.csv) | |
# Subset to keep only the MPA names and columns with extent data | |
# Make the columns that hold the MPA extent into usable numeric variables | |
# Watch out for decimals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Putting everything together #### | |
#### Chained data cleaning demonstration #### | |
# # | |
## %######################################################%## | |
# Load the raw Age of Empires units dataset from csv (aoe_raw.csv) | |
# Identify and fix common issues that make these data unusable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Pivoting Data - Your Turn #### | |
# # | |
## %######################################################%## | |
# Load the dog ranks data ("dogranks_your.csv") | |
# Pivot the data (wide to long and back to wide) | |
# load packages ----------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Coalesce and Fill - Your Turn #### | |
# # | |
## %######################################################%## | |
# Load the fish landings data 'fish-landings.csv' | |
# Fill the 'Fish' and 'Lake' columns | |
# Reorder the numeric variables ('Comission reported total' first) | |
# create a new column, coalescing the three numeric variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Working with columns with 'across' - 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Useful dplyr functions - your turn #### | |
# # | |
## %######################################################%## | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Duplicates - your turn #### | |
# # | |
## %######################################################%## | |
# Load the messy Age of Empires units dataset bundled with `unheadr` (AOEunits_raw) | |
# Keep only units of Type "Cavalry" | |
# Identify duplicated records across all variables | |
# Remove duplicated records across all variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Missing, implicit, or misplaced #### | |
#### grouping variables - your turn #### | |
# # | |
## %######################################################%## | |
# Load the `primates2017` dataset bundled with 📦 `unheadr` | |
# Create a new column that groups the different species by taxonomic family. | |
# In biology, taxonomic families all end in the suffix "_DAE_" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## %######################################################%## | |
# # | |
#### Regex for data cleaning - your turn #### | |
# # | |
## %######################################################%## | |
# 1. Download CRAN package descriptions | |
# 2. Select Package name, author, description, and all variables that end in 'ports' | |
# 3. Filter rows for packages with names that: | |
# - end in plot |