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(lubridate) | |
weather_import <- read_rds("weather.rds") %>% | |
mutate(rainfall = if_else(rainfall_mm == 0, "no rain", "rain")) %>% | |
select(date, rainfall) | |
day_of_week_effects <- tibble::tribble( | |
~weekday, ~dow_diff, |
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) | |
# http://www.bom.gov.au/climate/data/index.shtml?bookmark=201 | |
# http://www.bom.gov.au/climate/dwo/IDCJDW3050.latest.shtml | |
# an eg csv file | |
# "http://www.bom.gov.au/climate/dwo/202006/text/IDCJDW3050.202006.csv" | |
csv_url_template <- "http://www.bom.gov.au/climate/dwo/{ym_val}/text/IDCJDW3050.{ym_val}.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(pdftools) | |
library(httr) | |
library(openxlsx) | |
url <- "http://2020.erum.io/wp-content/uploads/2020/06/program_brochure_v5_20200617.pdf" | |
GET(url, write_disk(tf <- tempfile(fileext = ".pdf"))) | |
import <- pdf_text(tf) |
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) | |
################################################################### | |
# create some dummy data | |
today <- tibble(Cases = seq(1, 5000, by = 50)) | |
################################################################### |
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(shiny) | |
library(tidyverse) | |
library(shinythemes) | |
################################################################### | |
# bring in some dummy data for demonstration purposes | |
data_us <- tribble( | |
~title, ~main, ~new, |
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(httr) | |
latest_two_csv_files <- | |
GET("https://api.github.com/repos/CSSEGISandData/COVID-19/git/trees/master?recursive=1") %>% | |
jsonlite::parse_json() %>% | |
pluck("tree") %>% | |
map(pluck("path")) %>% | |
unlist() %>% | |
as_tibble() %>% |
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) | |
# let's start with some familiar data | |
# Why are you doing this workshop? | |
# Please rank your top 3 | |
responses <- c( | |
"To improve my job prospects", | |
"To gain life experiences", |
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(lubridate) | |
library(tidyverse) | |
library(rlang) | |
set.seed(123) | |
new_table <- tibble( | |
Date = seq.Date(as.Date("2016-01-01"), as.Date("2019-12-31"), 1)) %>% | |
mutate(total_sales = rnorm(n())) |
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(rlang) | |
library() | |
set.seed(123) | |
new_table <- tibble(Date = seq.Date(as.Date("2016-01-01"), as.Date("2019-12-31"), 1)) %>% | |
mutate(total_sales = rnorm(n())) | |
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
setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) | |
library(tidyverse) | |
library(kableExtra) | |
formatted_Values <- tibble::tribble( | |
~Metric, ~BAKER, ~OREGON, ~RURAL, ~URBAN, | |
"Food insecurity", "15%", "13%", NA, NA, | |
"Child Poverty", "23%", "19%", "18%", "20%", | |
"Foster care rate (per 1,000 population)", "33", "13", "21", "11", | |
"Index crime (per 1,000 population)", "20", "30", "20", "32", |