Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Looking for work opportunities

Luis Verde Arregoitia luisDVA

💭
Looking for work opportunities
View GitHub Profile
View regex-04_regex-data-cleaningyt1.R
## %######################################################%##
# #
#### Regex for data cleaning 1 - your turn ####
# #
## %######################################################%##
# After running the code below:
library(ggplot2)
library(dplyr)
View regex-03_regex-data-cleaningyt.R
##%######################################################%##
# #
#### Regex in R - Your Turn ####
# #
##%######################################################%##
# Match the following regular expressions against the test vector below using `str_detect`.
## Can you explain the matches?
View common-issues-03_lettercase.R
## %######################################################%##
# #
#### Letter case - your turn ####
# #
## %######################################################%##
# Import the Marine Protected Areas dataset (MPAS-your.csv)
# Summarize the number of Marine Protected Areas by country (Country full).
View common-issues-05_compound-values.R
## %######################################################%##
# #
#### Compound values - your turn ####
# #
## %######################################################%##
# Import the Marine Protected Areas dataset (MPAS-your.csv)
# Separate the country codes variable (ISO3 and UN scheme)
# Unnest the Reference variable
# > Keep an eye on the separators
View common-issues-01_unusable-headers.R
## %######################################################%##
# #
#### Unusable variable names - your turn ####
# #
## %######################################################%##
# - Import the Marine Protected Areas data (MPAS-your.csv)
# - Make the variable names usable by placing all header fragments in a single
# header row
# - Clean the names for consistency
View common-issues-02_whitespace.R
## %######################################################%##
# #
#### Whitespace - your turn ####
# #
## %######################################################%##
# - Import the Marine Protected Areas data (MPAS-your.csv) from the previous lesson
# - check the Country variable for leading or trailing whitespace
# - Remove it if necessary.
View common-issues-07_broken-values.R
## %######################################################%##
# #
#### Broken values - your turn ####
# #
## %######################################################%##
# Load the raw Age of Empires units dataset from csv (aoe_raw.csv)
# Identify the broken values in both the 'Type' and 'Name' columns and unbreak them
# Clean up any separator-related issues arising from the 'unbreaking'
View common-issues-08_empty-rows-columns.R
## %######################################################%##
# #
#### 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
View common-issues-09_parsing-numbers.R
## %######################################################%##
# #
#### 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
@luisDVA
luisDVA / common-issues-10_aoe-demo.R
Last active Jan 12, 2021
Putting everything together
View common-issues-10_aoe-demo.R
## %######################################################%##
# #
#### 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