Skip to content

Instantly share code, notes, and snippets.

View andrewheiss's full-sized avatar
πŸ‘¨β€πŸ’»
#rstats-ing all the things

Andrew Heiss andrewheiss

πŸ‘¨β€πŸ’»
#rstats-ing all the things
View GitHub Profile
# Monkeys, Shakespeare, typewriters, &c. ----
library(tidyverse)
# Use 9 CPUs
mirai::daemons(9)
# For computability, loop through 200,000,000 seeds
number_of_seeds <- 2e8
@andrewheiss
andrewheiss / quarto-dev.sh
Last active March 23, 2026 02:55
Install the development version of Quarto on Posit Cloud (or any sudo-less linux installation)
# Get latest 1.9
VER=$(curl -sL https://quarto.org/docs/download/_prerelease.json | grep -o '"version": "[^"]*' | grep -o '[^"]*$')
mkdir -p ~/quarto
curl -L "https://github.com/quarto-dev/quarto-cli/releases/download/v${VER}/quarto-${VER}-linux-amd64.tar.gz" | tar -xz -C ~/quarto --strip-components=1
# Add to system path so terminal uses it
echo 'export PATH="$HOME/quarto/bin:$PATH"' >> ~/.profile
# Add to .Rprofile path so RStudio uses it
echo 'Sys.setenv(PATH = paste0(Sys.getenv("HOME"), "/quarto/bin:", Sys.getenv("PATH")))' >> ~/.Rprofile
# Adapted from Matt Parker's video here: https://www.youtube.com/watch?v=kahGSss6SsU
# Based on this paper here: https://arxiv.org/abs/2602.14487
library(tidyverse)
library(readxl)
# A "run" ends when cumulative heads first exceed 50% of flips
# The expected value of heads/total at that stopping time is pi/4
# Extract the heads/total ratio at the end of each run
library(tidyverse)
library(parameters)
library(ggdist)

# :(
lm(body_mass ~ 0 + species, data = penguins) |>
  model_parameters() |>
  ggplot(aes(x = Coefficient, y = Parameter, color = Parameter)) +
  geom_pointrange(
library(tidyverse)
ggplot(data = tibble(x = 1, y = "A"), aes(x = x, y = y)) +
geom_pointrange(aes(xmin = 0.5, xmax = 1.5), color = "#1D6996") +
annotate(
geom = "text",
label = "geom_pointrange()",
x = 1,
y = 1.5,
hjust = 0.5,
#!/usr/bin/env bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Create Positron playground project
# @raycast.mode silent
# Optional parameters:
# @raycast.argument1 { "type": "text", "placeholder": "Project folder name" }
# @raycast.icon πŸ›

In this paper, the authors explore β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ. This is important work!

The theory is strong and the qualitative work is well done and complements the experiment. I have some reservations and questions about the methods and analysis, but these issues are all fixable. I list my observations and comments below.


praise: This is an excellent and tightly written experiment that tests a specific, narrow, important hypothesis in a rigorous way. This is all incredibly fascinating and well done!


library(tidyverse)
library(tidytext)
library(schrute)
library(rcartocolor)
library(ggh4x)
# Get all the words as single rows
all_words <- schrute::theoffice |>
mutate(season_cat = factor(season)) |>
unnest_tokens(output = word, input = text) |>
library(tidyverse)
# Download the annual HadCRUT.5.1.0.0 data from
# https://www.metoffice.gov.uk/hadobs/hadcrut5/data/HadCRUT.5.1.0.0/download.htm
hadcrut <- read_csv(
"HadCRUT.5.1.0.0.analysis.summary_series.global.annual.csv"
) |>
rename(
anomaly = `Anomaly (deg C)`,
conf_low = `Lower confidence limit (2.5%)`,
library(tidyverse)
library(sf)
library(rnaturalearth)
library(ggtext)
clr_ocean <- "#d9f0ff"
clr_land <- "#facba6"
world <- ne_countries(scale = 110) |>
filter(admin != "Antarctica")