Skip to content

Instantly share code, notes, and snippets.

View USMortality's full-sized avatar

USMortality.com USMortality

View GitHub Profile
@USMortality
USMortality / asmr_country_dataset.r
Last active December 27, 2024 20:19
eASMR (3y) Country Dataset including other variables
library(readr)
library(dplyr)
library(tsibble)
library(stringr)
library(fable)
library(tidyr)
library(lubridate)
library(countrycode)
options(vsc.dev.args = list(width = 600 * 2, height = 600 * 2, res = 72 * 2))
@USMortality
USMortality / .chart_world_easmr_vaxx_adj.r
Last active April 15, 2025 13:47
Adjusted Excess Age-Standardized Mortality Rate (eASMR*) vs Share of Population COVID-19 Vaccinated (1st) [World]
library(readr)
library(scales)
library(ggpubr)
library(ggpmisc)
library(ggrepel)
source(paste0(
"https://gist.githubusercontent.com/USMortality/",
"cf0dc23d0d5ca609539fe11c9c089fcc/raw/asmr_country_dataset.r"
))
@USMortality
USMortality / .chart_usa_counties_vs_hsa.r
Last active April 15, 2025 01:39
Continental Counties vs Health Service Areas (HSA) [USA]
library(tigris)
library(ggplot2)
library(dplyr)
library(readxl)
library(sf)
sf <- 2
width <- 1920 * sf
height <- 1080 * sf
@USMortality
USMortality / chart_germany_asmr.r
Last active February 27, 2025 03:13
Age-Standardized Mortality Rate (ASMR) [Germany]
library(tidyverse)
library(scales)
library(zoo)
library(ggrepel)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
@USMortality
USMortality / chart_santa-clara-ca_covid19_cases_deaths_cfr.r
Last active October 25, 2024 00:10
7-Day Moving Average of Cases, Deaths, and CFR [Santa Clara County, CA]
library(readr)
library(ggplot2)
library(slider)
library(scales)
library(dplyr)
sf <- 2
width <- 600 * sf
height <- 335 * sf
@USMortality
USMortality / chart_ca-santa-clara_covid19_cases_tests_positivity.r
Last active February 28, 2025 16:36
7-Day Moving Average of Cases, Tests, and Positivity [Santa Clara County, CA]
library(ggplot2)
library(slider)
library(scales)
library(dplyr)
library(readr)
library(tsibble)
sf <- 2
width <- 600 * sf
height <- 335 * sf
@USMortality
USMortality / chart_usa_cmr_asmr_mortality_cancer_month_age.r
Last active March 13, 2025 18:15
Age-Standardized & Crude Cancer Deaths by Month & 5y Age Group [USA]
library(readr)
library(tidyr)
library(ggplot2)
library(dplyr)
library(fable)
library(tsibble)
sf <- 2
width <- 900 * sf
height <- 450 * sf
@USMortality
USMortality / chart_usa_population_age_group.r
Last active February 14, 2025 19:55
Population Trends by Age Group [USA]
library(readr)
library(dplyr)
library(ggplot2)
library(tsibble)
library(scales)
sf <- 2
width <- 600 * sf
height <- 335 * sf
@USMortality
USMortality / chart_usa_cmr_month.r
Last active February 14, 2025 19:55
Crude Mortality Rate by Age Group [USA]
library(readr)
library(tidyr)
library(ggplot2)
library(dplyr)
library(fable)
library(tsibble)
sf <- 2
width <- 900 * sf
height <- 450 * sf
@USMortality
USMortality / pdf-ocr.sh
Last active October 21, 2024 15:43
OCR PDF
#!/bin/bash
# Ensure the required tools are installed
command -v pdftoppm >/dev/null 2>&1 || {
echo "pdftoppm is not installed. Exiting."
exit 1
}
command -v tesseract >/dev/null 2>&1 || {
echo "Tesseract is not installed. Exiting."
exit 1