2 Installation
This chapter walks you through installing the tools you need for your first project. We’ll install more tools (Git, conda) later when you need them in Part 2.
Several steps below require running commands in a terminal (also called a command line). On macOS, open the built-in Terminal app (search for “Terminal” in Spotlight). On Windows, open PowerShell from the Start menu. You’ll type or paste commands there and press Enter to run them.
2.1 1. Positron
Positron is a data science IDE (Integrated Development Environment) built by the makers of RStudio. It combines the best features of RStudio, like an integrated data viewer, variable explorer, and plot pane, with the modern editing experience of VS Code. Unlike RStudio, Positron treats both R and Python equally, making it ideal for working in both languages. It’s also highly moddable, with access to the full set of VS Code extensions, including Claude Code.
2.1.1 macOS
- Download Positron from https://positron.posit.co
- Open the
.dmgfile and drag Positron to your Applications folder - Open Positron from Applications
2.1.2 Windows
- Download Positron from https://positron.posit.co
- Run the installer (
.exefile) - Follow the installation prompts
- Launch Positron from the Start menu
When you first open Positron, it may ask to install recommended extensions. Accept these defaults. You may also see a message in the Source Control panel (left sidebar) about Git not being installed — just ignore this for now. We’ll install Git later in Part 2.
2.2 2. R (using rig)
We install R using rig (R Installation Manager) rather than downloading directly from CRAN. Rig makes it easy to install R, switch between R versions, and keep R updated, all from the command line. Most importantly, it installs new R versions without overwriting or deleting previous versions, a common problem encountered when installing precompiled packages from the main R website. This is especially useful when you want to install the newest version of R to use with a new project while still maintaining older versions associated with older projects.
If you already have R installed, you can skip rig for now — any recent version of R (4.0+) will work for this tutorial. We still recommend installing rig for future projects, because it makes managing multiple R versions painless, but it’s not required to get started.
2.2.1 macOS
- Download the latest rig installer from https://github.com/r-lib/rig/releases
- Choose the
.pkgfile (e.g.,rig-macos-arm64.pkgfor Apple Silicon orrig-macos-x86_64.pkgfor Intel Macs)
- Choose the
- Double-click the
.pkgfile and follow the installation prompts
Then open a terminal and install the latest R version:
rig add releaseThis installs the current stable release of R (4.5.x as of this writing). You want at least R 4.4 or newer — Positron works best with recent R versions, and newer Seurat releases require R 4.4+.
After the install finishes, close and reopen your terminal, then verify the installation:
R --versionrig list— See installed R versionsrig add release— Install latest stable Rrig add devel— Install development versionrig default <version>— Set default R version
2.2.2 Windows
- Download the rig installer from https://github.com/r-lib/rig/releases
- Choose
rig-windows-latest.exe
- Choose
- Run the installer
- Open a new PowerShell window (this is important — a fresh window picks up the new installation) and install R:
rig add releaseThis installs the current stable release (4.5.x as of this writing). You want at least R 4.4 or newer.
- Close and reopen PowerShell, then verify:
R --version2.2.3 Why rig?
- Easy updates:
rig add releasealways gets the latest version - Multiple versions: Install R 4.3 and R 4.4 side by side for testing
- Consistent: Same commands on macOS and Windows
You’ll learn more about managing R versions in the rig & renv chapter.
2.3 3. Quarto
Quarto is a scientific publishing system that lets you combine code, results, and narrative text in a single document. You write in Markdown with embedded R or Python code chunks, and Quarto renders it to HTML, PDF, Word, or other formats—with your code output automatically included. If you’ve used R Markdown, Quarto is its successor—same core idea, but with more features and equal support for Python. This is the modern approach to reproducible research: your analysis and your report are the same document, so results stay in sync with the code that produced them. In fact, this book was built with Quarto!
2.3.1 macOS
If you have Homebrew (a popular macOS package manager), you can install Quarto from the terminal:
brew install quartoIf you don’t have Homebrew, download the installer from https://quarto.org/docs/get-started/ instead.
After installing, close and reopen your terminal, then verify:
quarto --version2.3.2 Windows
Download and run the installer from https://quarto.org/docs/get-started/
After installing, close and reopen PowerShell, then verify:
quarto --version2.4 4. Claude Code
Claude Code is an AI coding assistant that runs in your terminal or integrates directly into Positron. Unlike chat-based AI tools, Claude Code can read and write files in your project, run commands, and help you build and debug code interactively. It can see and work with your entire codebase, making it useful for writing code, explaining unfamiliar code, debugging errors, and planning larger projects. Think of it as a knowledgeable collaborator who’s always available.
2.4.1 Prerequisites
You need Node.js 18+ installed. In your terminal:
macOS (using Homebrew):
brew install nodeWindows: Download and install from https://nodejs.org (choose the LTS version). After installing, close and reopen PowerShell. If you get a “running scripts is disabled” error in the next step, see the fix below.
2.4.2 Install Claude Code
In your terminal, run:
npm install -g @anthropic-ai/claude-code2.4.3 Authenticate
Run Claude Code once to set up authentication:
claudeClaude Code will ask how you want to authenticate. You’ll see several options — make sure you choose Use OAuth (Anthropic account), not “Use an API key.” The API key option connects to a separate pay-per-use billing system, which is not what you want. OAuth connects to your existing Claude Pro subscription at no extra cost.
This will open a browser window where you log in with your Anthropic account — the same email and password you use for claude.ai. Once you approve the connection in the browser, Claude Code is ready to use in the terminal. If you accidentally chose the API key option, run claude logout and then claude again to pick OAuth.
You need a Claude Pro or Max subscription to use Claude Code. All lab members have personal subscriptions — if yours isn’t set up yet, ask Jake.
2.4.4 Install the Positron Extension
Claude Code integrates directly into Positron as an extension:
- Open Positron
- Go to the Extensions view (Cmd+Shift+X on macOS, Ctrl+Shift+X on Windows)
- Search for “Claude Code”
- Click Install
You’ll see a Claude Code panel in Positron’s sidebar. You can use it right alongside your code editor, console, and plots pane.
2.5 Verification Checklist
Open a fresh terminal window and run these commands to verify everything is installed:
R --version
quarto --version
claude --versionAll commands should return version numbers without errors. Open Positron and confirm it launches.
Claude Code can help troubleshoot installation problems by checking your paths, versions, and configuration.
I just installed R and Quarto. Here’s what I get when I run the version commands: [paste your output]. Does this look right, or is something misconfigured?
Claude will check that paths are correct, versions are compatible, and flag common installation issues like missing PATH entries or conflicting installations.
2.6 Troubleshooting
If you run into problems, check the solutions below before moving on. See Troubleshooting for additional common issues.
2.6.1 “Command not found” errors
If any command fails with “command not found” (macOS) or “is not recognized” (Windows), try opening a new terminal window. Newly installed tools often aren’t available until you start a fresh terminal session.
2.6.2 Windows: “Running scripts is disabled on this system”
If you see this error when running npm install on Windows:
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running
scripts is disabled on this system.
Windows PowerShell blocks scripts by default. You need to change the execution policy:
- Open PowerShell as Administrator — search for “PowerShell” in the Start menu, right-click it, and select Run as administrator
- Run this command:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned- Type Y and press Enter to confirm
This allows locally created scripts (like npm) to run while still requiring downloaded scripts to be signed. After this, close the administrator PowerShell and open a regular PowerShell window to continue the installation.
2.7 What About Git, Conda, and GitHub?
You’ll install these later when you need them:
- Conda (Python environments) — installed in the Conda chapter
- Git (version control) — installed in the Git & GitHub chapter
- GitHub account — set up in the Setting Up a Lab Project walkthrough
For now, you have everything you need. Let’s build your first project.