Skip to content

Instantly share code, notes, and snippets.

View USMortality's full-sized avatar

USMortality.com USMortality

View GitHub Profile
@USMortality
USMortality / chart_fertility_vs_vaccination_europe.r
Created June 18, 2025 16:17
COVID-19 Vaccinations vs. Excess Fertility [Europe]
library(tidyverse)
library(ggpubr)
library(tsibble)
library(fable)
library(ggpmisc)
library(ggrepel)
library(scales)
sf <- 2
width <- 1200 * sf
@USMortality
USMortality / chart_mortality_ucd_chapter_usa.r
Created June 14, 2025 16:41
Total Deaths/Mortality by Selected UCD Chapters [USA, Western Census Region]
library(data.table)
library(ggplot2)
sf <- 2
width <- 900 * sf
height <- 450 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
# Load data
s <- fread(
@USMortality
USMortality / chart_vaccine_mcd_usa.r
Last active June 8, 2025 20:47
Vaccine Related Deaths [USA]
library(data.table)
library(ggplot2)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
# All potential vaccine related ICD10 codes
elevated_icd10 <- c(
@USMortality
USMortality / chart_usa_cancer_incidence_mortality.r
Created May 29, 2025 15:30
Crude Cancer Incidence & Mortality [USA]
library(readr)
library(tidyr)
library(ggplot2)
library(dplyr)
library(fable)
library(tsibble)
sf <- 2
width <- 900 * sf
height <- 450 * sf
@USMortality
USMortality / deploy.sh
Last active April 14, 2025 20:18
Dokku deploy script
#!/usr/bin/env bash
# Require IP argument or environment variable
IP="${1:-${IP}}"
if [ -z "$IP" ]; then
echo "❌ Error: IP is required."
echo "Usage: IP=1.2.3.4 ./deploy.sh"
echo " or: ./deploy.sh 1.2.3.4"
exit 1
@USMortality
USMortality / dl.r
Last active March 20, 2025 02:21
JFK Assassination Records - 2025 Documents Release
# Download all previously release files
library(httr) # Load httr for GET function
library(readxl) # Load readxl for reading Excel files
read.xls <- function(url) {
# Create a temporary file
temp_file <- tempfile(fileext = ".xlsx")
# Download the file to the temporary location
GET(url, write_disk(temp_file, overwrite = TRUE))
@USMortality
USMortality / chart_tatverdaechtigenrate_d_a.r
Last active March 11, 2025 12:42
Tatverdächtigenraten von Deutschen und Ausländern
library(ggplot2)
library(readr)
library(dplyr)
library(stringr)
library(scales)
library(ggrepel)
sf <- 2
width <- 600 * sf
height <- 335 * sf
@USMortality
USMortality / bundesliga2_forecast.r
Last active March 2, 2025 16:35
2. Bundesliga Standings
library(tidyverse)
# Load and preprocess the dataset
df <- read_csv("https://www.football-data.co.uk/mmz4281/2425/D2.csv") |>
mutate(Date = as.Date(Date, format = "%d/%m/%Y")) |>
select(Date, HomeTeam, AwayTeam, FTR) |>
arrange(Date)
# Ensure unique set of teams per matchday
matchday_counter <- 1
@USMortality
USMortality / Cancer Age-Adjusted Mortality Rate [USA]
Created February 1, 2025 19:54
chart_usa_cancer_year_asmr.r
library(readr)
library(tidyr)
library(ggplot2)
library(dplyr)
library(fable)
library(tsibble)
sf <- 2
width <- 900 * sf
height <- 450 * sf
@USMortality
USMortality / data_deutschland_are_ili.r
Created January 28, 2025 17:02
Data: Deutschland ARE/ILI
library(readr)
library(dplyr)
library(tidyr)
df <- read_tsv(
paste0(
"https://raw.githubusercontent.com/robert-koch-institut/",
"GrippeWeb_Daten_des_Wochenberichts/main/",
"GrippeWeb_Daten_des_Wochenberichts.tsv"
)