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(tidyverse) | |
student_name <- | |
rstudioapi::showPrompt(title = "Name", message = "What's your first name?") | |
dat %>% | |
write_csv(here::here("submit", str_glue("final_{student_name}.csv"))) |
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(tidyverse) | |
library(gt) | |
dat <- | |
tibble::tribble( ~ C1, ~ C2, | |
19L, 73L, | |
92L, 83L, | |
35L, 70L, | |
40L, 12L) %>% | |
dplyr::mutate(c1_parity = case_when(C1 %% 2 == 0 ~ "Even", |
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(tidyverse) | |
# devtools::install_github("UrbanInstitute/urbnmapr") | |
library(urbnmapr) | |
# devtools::install_github("UrbanInstitute/urbnthemes") | |
library(urbnthemes) | |
library(janitor) | |
set_urbn_defaults(style = "map") | |
nurses <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-10-05/nurses.csv') %>% |
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
# Enrollment Demographics Stacked Bar Plot | |
# Libraries --------------------------------------------------------------- | |
library(tidyverse) | |
library(geofacet) | |
library(showtext) | |
library(cowplot) | |
font_add_google("Noto Sans", "noto-sans") |
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(tidyverse) | |
library(ggthemr) | |
ggthemr("dust") | |
tuesdata <- tidytuesdayR::tt_load('2021-01-26') | |
plastics <- tuesdata$plastics | |
plastics_group <- | |
plastics %>% |
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(tidyverse) | |
relig_income <- relig_income %>% | |
pivot_longer(!religion, names_to = "income", values_to = "count") | |
relig_plot <- function(.x) { | |
relig_income %>% | |
filter(religion == .x) %>% { | |
ggplot(., aes(x = income, y = count, fill = religion)) + | |
geom_bar(stat = "identity", position = "dodge") |
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
########################################################## | |
# Get Ages of Top 100 Super Smash Brothers Melee Players # | |
########################################################## | |
# Tutorial ---------------------------------------------------------------- | |
# https://www.r-bloggers.com/2020/05/intro-to-polite-web-scraping-of-soccer-data-with-r/ | |
# Library ----------------------------------------------------------------- |
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
# Libraries | |
library(tidyverse) | |
library(sf) | |
library(ggmap) | |
# Open files | |
f <- | |
here::here("data", "raw", "GRSM_TRAILS-shp", "GRSM_TRAILS.shp") |
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
# Advent of Code - Day 03 | |
# Data -------------------------------------------------------------------- | |
dat <- | |
as.matrix(read.fwf( | |
here::here("day_03", "trees.txt"), | |
widths = rep(1, 31), | |
comment.char = "" | |
)) |
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(tidyverse) | |
# Input ------------------------------------------------------------------- | |
input <- | |
tibble::tribble( | |
~ `passwords`, | |
"13-16 k:kkkkkgmkbvkkrskhd", | |
"5-6 p: qpppvzp", | |
"3-4 p: psppxhlfpvkh", |