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
# exploring comments about loaded packages | |
library(bigrquery) # CRAN v1.4.1 | |
library(dplyr) # CRAN v1.1.1 | |
library(stringr) # CRAN v1.5.0 | |
library(readr) # CRAN v2.1.4 | |
library(tidyr) # CRAN v1.3.0 | |
library(rlang) # CRAN v1.1.0 | |
library(purrr) # CRAN v1.0.1 | |
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
library(ggsvg) | |
library(ggplot2) | |
# the svg that I need to use | |
svg_url <- "https://raw.githubusercontent.com/luisDVA/luisdva.github.io/master/assets/images/Cat-green.svg" | |
cat_svg <- paste(readLines(svg_url), collapse = "\n") | |
# toy data | |
dat <- | |
expand.grid(y=1:2,x=seq_len(2)) | |
dat$qual <- letters[1:4] |
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
# lista 1 | |
dat1a <- tibble(id=c("A","B","C","D","E"),val=rnorm(5)) | |
dat1b <- tibble(id=c("A","B","C","D","E"),val=rnorm(5)) | |
dat1 <- list(dat1a,dat1b) | |
dat1 | |
# lista dos | |
dat2a <- tibble(id=c("A","D","E"),label=rnorm(3)) | |
dat2b_1 <- tibble(id=c("A","B","C","E"),label=rnorm(4)) |
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 1 - your turn #### | |
# # | |
## %######################################################%## | |
# After running the code below: | |
library(ggplot2) | |
library(dplyr) |
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 in R - Your Turn #### | |
# # | |
##%######################################################%## | |
# Match the following regular expressions against the test vector below using `str_detect`. | |
## Can you explain the matches? |
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
## %######################################################%## | |
# # | |
#### Letter case - your turn #### | |
# # | |
## %######################################################%## | |
# Import the Marine Protected Areas dataset (MPAS-your.csv) | |
# Summarize the number of Marine Protected Areas by country (Country full). |
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
## %######################################################%## | |
# # | |
#### 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 |
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
## %######################################################%## | |
# # | |
#### 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 |
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
## %######################################################%## | |
# # | |
#### 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. |
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
## %######################################################%## | |
# # | |
#### 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' |
NewerOlder