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

  1. Download Positron from https://positron.posit.co
  2. Open the .dmg file and drag Positron to your Applications folder
  3. Open Positron from Applications

2.1.2 Windows

  1. Download Positron from https://positron.posit.co
  2. Run the installer (.exe file)
  3. Follow the installation prompts
  4. Launch Positron from the Start menu
TipFirst Launch

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.

NoteAlready have R?

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

  1. Download the latest rig installer from https://github.com/r-lib/rig/releases
    • Choose the .pkg file (e.g., rig-macos-arm64.pkg for Apple Silicon or rig-macos-x86_64.pkg for Intel Macs)
  2. Double-click the .pkg file and follow the installation prompts

Then open a terminal and install the latest R version:

rig add release

This 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 --version
Tiprig Commands
  • rig list — See installed R versions
  • rig add release — Install latest stable R
  • rig add devel — Install development version
  • rig default <version> — Set default R version

2.2.2 Windows

  1. Download the rig installer from https://github.com/r-lib/rig/releases
    • Choose rig-windows-latest.exe
  2. Run the installer
  3. Open a new PowerShell window (this is important — a fresh window picks up the new installation) and install R:
rig add release

This installs the current stable release (4.5.x as of this writing). You want at least R 4.4 or newer.

  1. Close and reopen PowerShell, then verify:
R --version

2.2.3 Why rig?

  • Easy updates: rig add release always 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 quarto

If 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 --version

2.3.2 Windows

Download and run the installer from https://quarto.org/docs/get-started/

After installing, close and reopen PowerShell, then verify:

quarto --version

2.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 node

Windows: 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-code

2.4.3 Authenticate

Run Claude Code once to set up authentication:

claude

Claude 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.

NoteAnthropic Account

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:

  1. Open Positron
  2. Go to the Extensions view (Cmd+Shift+X on macOS, Ctrl+Shift+X on Windows)
  3. Search for “Claude Code”
  4. 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 --version

All commands should return version numbers without errors. Open Positron and confirm it launches.

WarningClaude Code

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:

  1. Open PowerShell as Administrator — search for “PowerShell” in the Start menu, right-click it, and select Run as administrator
  2. Run this command:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
  1. 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:

For now, you have everything you need. Let’s build your first project.