-
-
Save dgkeyes/4ec54d806645f19811f790b074e3c508 to your computer and use it in GitHub Desktop.
Letter case
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). | |
# load packages ----------------------------------------------------------- | |
library(readr) | |
library(stringr) | |
library(dplyr) | |
library(unheadr) | |
library(janitor) | |
library(snakecase) | |
# import data ------------------------------------------------------------- | |
MPAs <- read_csv("data/MPAS-your.csv") %>% | |
mash_colnames(1) %>% | |
clean_names() | |
# clean strings and summarize --------------------------------------------- | |
MPAs %>% | |
mutate(country_full = to_title_case(country_full, parsing_option = 0)) %>% | |
count(country_full) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment