Skip to content

Instantly share code, notes, and snippets.

@trilin6
Created May 11, 2025 10:52
Show Gist options
  • Select an option

  • Save trilin6/68ad0a701f0acf904a558f3286efceda to your computer and use it in GitHub Desktop.

Select an option

Save trilin6/68ad0a701f0acf904a558f3286efceda to your computer and use it in GitHub Desktop.
R DevContainers V2 Guide

πŸ§ͺ VS Code Dev Containers for R β€” Ranked & Explained

A ranked comparison of R dev containers that work great in VS Code, both locally with Docker and remotely via GitHub Codespaces.


βœ… Summary

  • VS Code support: Yes β€” fully usable without RStudio Server
  • Local: Works via Docker + VS Code
  • Codespaces: Fully supported
  • Includes: R, RStudio Server (optional), Quarto CLI, renv, tidyverse, devtools, languageserver
  • πŸ”§ Workshop-ready with teaching tools included

πŸ”§ Local Setup

git clone https://github.com/revodavid/devcontainers-rstudio.git
cd devcontainers-rstudio

Open the folder in VS Code and run: Dev Containers: Reopen in Container

☁️ Codespaces Setup


βœ… Summary

  • VS Code support: Yes
  • Local: Supported via Docker
  • Codespaces: Optimized for GitHub Codespaces
  • Includes: Fast R setup using r2u, tidyverse, quarto, devtools, and more
  • ⚑ CRAN packages install almost instantly via apt

πŸ”§ Local Usage

git clone https://github.com/grantmcdermott/codespaces-r2u.git
cd codespaces-r2u

Open in VS Code and reopen in container.

☁️ Codespaces Usage

  • Open: codespaces-r2u
  • Click: Code β†’ Codespaces β†’ New codespace

βœ… Summary

  • VS Code support: Yes

  • Local & Codespaces: Supported

  • Includes: A collection of starter templates:

    • r-ver – Base R
    • r2u – Fast CRAN
    • r-devel – Development builds

These are templates, not full dev environments β€” you build on top of them.

🧰 To use:

devcontainer templates apply

πŸ§ͺ Summary

  • Minimal example for trying R in dev containers
  • Good for exploration, not full workflows

πŸ“š Summary

  • Tutorial-oriented
  • Less complete than devcontainers-rstudio
  • Still good for teaching small workshops

πŸ› οΈ Want a Custom Setup?

Want a minimal container with:

  • R + VS Code (no RStudio)
  • tidyverse, data.table, devtools
  • Quarto support
  • Pre-installed extensions or Git hooks?

Let me know β€” I can help scaffold a clean, shareable dev environment tailored to your needs.


Let me know if you'd like this saved as a README.md or injected into a repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment