Skip to content

Instantly share code, notes, and snippets.

View USMortality's full-sized avatar

USMortality.com USMortality

View GitHub Profile
@USMortality
USMortality / chart_world.r
Last active February 16, 2026 18:07
World Equity (Blended US + ex-US / VT) — Log-Trend & Super-Cycle Analysis | ERN historical data from 1971 + Yahoo Finance
#!/usr/bin/env Rscript
# ═══════════════════════════════════════════════════════════════
# World Equity (Blended US + ex-US / VT) — Log-Trend & Super-Cycle
# Charts: 1_ Price+Trend, 2_ Deviation+Supertrend, 3_ Normalized
# Data: ERN SWR Toolbox (1871–2025) + Yahoo Finance (recent)
# Blend uses time-varying US market-cap weights (approx.)
# ═══════════════════════════════════════════════════════════════
library(tidyverse)
library(quantmod)
@USMortality
USMortality / chart_exus.r
Last active February 16, 2026 18:07
Ex-US Equity (World ex-US / VXUS) — Log-Trend & Super-Cycle Analysis | ERN historical data from 1971 + Yahoo Finance
#!/usr/bin/env Rscript
# ═══════════════════════════════════════════════════════════════
# Ex-US Equity (World ex-US / VXUS) — Log-Trend & Super-Cycle
# Charts: 1_ Price+Trend, 2_ Deviation+Supertrend, 3_ Normalized
# Data: ERN SWR Toolbox (1871–2025) + Yahoo Finance (recent)
# ═══════════════════════════════════════════════════════════════
library(tidyverse)
library(quantmod)
library(ggrepel)
@USMortality
USMortality / chart_us.r
Last active February 16, 2026 18:07
US Equity (S&P 500 TR / VTI) — Log-Trend & Super-Cycle Analysis | ERN historical data from 1971 + Yahoo Finance
#!/usr/bin/env Rscript
# ═══════════════════════════════════════════════════════════════
# US Equity (S&P 500 TR / VTI) — Log-Trend & Super-Cycle Analysis
# Charts: 1_ Price+Trend, 2_ Deviation+Supertrend, 3_ Normalized
# Data: ERN SWR Toolbox (1871–2025) + Yahoo Finance (recent)
# ═══════════════════════════════════════════════════════════════
library(tidyverse)
library(quantmod)
library(ggrepel)
@USMortality
USMortality / virus_h_tree.r
Last active December 25, 2025 15:48
Virus Hypothesis Tree
# Virus Hypotheses Tree - English & German versions
# Generates: virus_tree_en.png, virus_tree_de.png
generate_tree <- function(lang = "en") {
# Language-specific labels
labels <- if (lang == "en") {
list(
title = "Virus Hypotheses",
yes = "Yes", no = "No",
@USMortality
USMortality / chart_excess_deaths_vaers_usa.r
Last active July 20, 2025 12:46
Excess Deaths vs VAERS Reported Deaths [USA]
library(tidyverse)
library(tsibble)
library(lubridate)
library(scales)
library(fable)
library(fabletools)
# Set up high-res plotting
width <- 600 * 2
height <- 335 * 2
@USMortality
USMortality / .chart_fertility_vs_vaccination_europe.r
Last active February 19, 2026 19:23
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
Last active December 4, 2025 19:40
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