This file contains hidden or 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(scales) | |
madison_vrh <- get_ntd(agency = "City of Madison", ntd_variable = "VRH") | |
extrafont::loadfonts() | |
madison_vrh |> | |
filter(modes == "MB") |> | |
mutate(year = year(month), mo = month(month)) |> | |
filter(mo == 3) |> | |
summarize(mean_vrh = mean(value), .by = year) |> | |
ggplot(aes(year, mean_vrh)) + |
This file contains hidden or 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
download_bps_monthly <- function(bps_year, bps_month) { | |
bps_url <- paste0("https://www.census.gov/construction/bps/xls/cbsamonthly_", | |
bps_year, | |
bps_month, | |
".xls") | |
bps_dest <- paste0("data/bps/bps_", | |
bps_year, | |
bps_month, | |
".xls") |
This file contains hidden or 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
# Load packages ---- | |
library(sf) | |
library(terra) | |
library(dplyr) | |
library(ggplot2) | |
library(rayshader) | |
library(rgl) | |
library(tidyverse) | |
# Data sources |
This file contains hidden or 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(tidycensus) | |
library(tidyverse) | |
library(sf) | |
library(tmap) | |
birth <- get_acs(geography = "county", year = 2023, table = "B13002", geometry = TRUE, | |
summary_var = "B13002_001") | |
marriage <- get_acs(geography = "county", year = 2023, table = "B12001", | |
summary_var = "B12001_001") |
This file contains hidden or 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) | |
clim <- read_csv("c:/Users/user1/Downloads/StnData.csv", col_names = c("date", | |
"avg", | |
"hi", | |
"lo")) | |
clim |> group_by(yr = year(date), mo = month(date, label = T, abbr = TRUE)) |> | |
summarize(avg_temp = mean(avg)) |> | |
filter(mo %in% c("Jan", "Feb")) |> | |
pivot_wider(names_from = mo, values_from = avg_temp) |> | |
mutate(feb_warmer = if_else(Feb > Jan, TRUE, FALSE)) |> |
This file contains hidden or 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
# input: ["B04", "B03", "B02"], | |
DN <- 10000 # unit scaling. See page 40 in https://sentinel.esa.int/documents/247904/685211/Sentinel-2-MSI-L2A-Product-Format-Specifications.pdf | |
# make list of bands. any order, we'll use names | |
# adjust aggregation factor for quick testing | |
smp <- list(B02 = rast("B02.tif") |> aggregate(2) / DN, | |
B03 = rast("B03.tif") |> aggregate(2) /DN, | |
B04 = rast("B04.tif") |> aggregate(2) /DN | |
) |
This file contains hidden or 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(pins) | |
library(sf) | |
library(tidyverse) | |
library(lubridate) | |
library(jsonlite) | |
board <- board_s3("vzpins", | |
region = "us-east-1", | |
access_key = "", |
This file contains hidden or 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
harambee_tracts <- c(44, 45, 67, 69, 70, 81, 106, 1856, 1857, 1860) | |
milwaukee_tracts_2022 <- get_acs(geography = "tract", | |
state = 55, | |
county = "Milwaukee", | |
table = "B02001", | |
# summary_var = "B02001_001", | |
year = 2022, | |
output = "wide") |
This file contains hidden or 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
madison <- x |> filter(agency == "City of Madison" & modes == "MB" & tos == "DO" & year(month) >2018) | |
max_month <- madison |> filter(year(month) == max(year(month))) |> | |
summarize(max(month(month, label = T, abbr = F))) |> pull() | |
madison |> | |
mutate(month_label = month(month, label = T, abbr = T)) |> | |
ggplot(aes(month, value)) + | |
geom_col(aes(fill = month_label)) + | |
geom_line() + | |
theme_minimal() + |
This file contains hidden or 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(hexSticker) | |
library(ggplot2) | |
library(ntdr) | |
library(cowplot) | |
library(tidyverse) | |
bus <- magick::image_read_svg("c:/Users/user1/Downloads/train bus ferry.svg") | |
madison_bus <- get_ntd(agency = "City of Madison", modes = "MB") | |
p <- madison_bus |> |
NewerOlder