- R 65.5%
- SCSS 12.8%
- JavaScript 11.4%
- Shell 6.8%
- Lua 3.4%
- Other 0.1%
TidyTuesday
A collection of visualizations for Tidy Tuesdays, built as a Quarto website with R and Python support.
Website
Visit the live website: here
Local Development (Fedora 42 distrobox)
The recommended local setup uses a distrobox container based on Fedora 42.
One-time container setup
# Create the container
distrobox-assemble distrobox.ini
# Enter it and run the setup script
# (installs rig, R, rv, uv, Quarto, fish, pre-commit hook + syncs packages)
distrobox enter tidytuesday -- bash setup-dev.sh
Daily workflow
# Enter the container (opens fish shell)
distrobox enter tidytuesday
# Preview the site
quarto preview
What gets installed in the container
| Tool | Purpose |
|---|---|
| rig | Installs R 4.5.2 |
| rv | R package management (rproject.toml) |
| uv | Python package management (pyproject.toml) |
| Quarto | Site rendering |
| fish | Default shell in the container |
Adding or updating a post
All posts use freeze: true — their rendered outputs are cached in _freeze/ and committed to the repo. When you create or update a post:
# 1. Render locally to update the freeze cache
quarto render
# 2. Stage both the post and its freeze entry
git add posts/YEAR/week_N/ _freeze/posts/YEAR/week_N/
# 3. Commit
git commit
A pre-commit hook (installed by setup-dev.sh) enforces this: it will abort the commit if a staged .qmd file is missing its updated _freeze/ entry.
Creating new visualizations
Use the included script to generate a new post from the template:
# Minimal (uses defaults):
Rscript new-viz-from-template.R 2025年01月07日 "Coffee Analysis"
# With metadata flags:
Rscript new-viz-from-template.R \
-c "ggplot2, tidyverse" \
-u "R, ggplot2, tidyverse" \
-k "ggplot2, dplyr, tidyr" \
-f week01.png \
2025年01月07日 "Coffee Analysis"
# Help:
Rscript new-viz-from-template.R -h
Arguments:
date: Date in YYYY-MM-DD formattitle: Title for the analysis (quote if it contains spaces)-c: Comma-separated categories (default: "TidyTuesday")-u: Comma-separated tools used-k: Comma-separated key libraries (default: "ggplot2, dplyr")-f: Image filename (default: weekNN.png)
Project Structure
├── .forgejo/workflows/ # Forgejo/Codeberg Actions for deployment
├── _freeze/ # Frozen execution outputs (committed)
├── posts/ # Project posts (Quarto)
├── scripts/ # Dev scripts (pre-commit hook)
├── _site/ # Generated website (ignored)
├── rv/ # rv project library (ignored)
├── .venv/ # Python virtual environment (ignored)
├── rproject.toml # R project and package config
├── pyproject.toml # Python project and package config
├── distrobox.ini # Local dev container definition
└── _quarto.yml # Quarto configuration
Deployment
The site is automatically deployed to Codeberg Pages on push to main. Because all posts are frozen, CI only needs Quarto — no R or Python setup required:
- Checkout
- Install Quarto
quarto render(uses_freeze/cache)- Deploy to Codeberg Pages
Package Management
- R packages: Managed by rv (
rproject.toml) - Python packages: Managed by uv (
pyproject.toml) - Repository: Fast Linux binaries from p3m.dev
License
This project is open source and available under the MIT License.