5  Positron Getting Started

5.1 What is Positron?

Positron is a modern, VS Code-based data science IDE designed for R and Python workflows. For USACE data scientists, Positron is the recommended IDE for technical analysis projects where you want:

  • a project-oriented workflow (folders, git repos, reproducible projects),
  • an editor that scales from small scripts to larger codebases,
  • interactive analysis tools (console + plots + data viewing) in an integrated environment, and
  • a pathway to extend capabilities through vetted extensions (with USACE constraints noted below).

This chapter is an on-ramp. It is not a replacement for Positron’s official documentation. For feature walkthroughs and authoritative “how-to” guidance, use the vendor site:

5.2 Prerequisites (install these first)

Before installing or using Positron for R-based work, make sure your system has:

  1. R (required)
  2. RTools (Windows only; sometimes required)

Install R (required)

R provides the runtime that Positron uses to run your R scripts and render R/knitr outputs.

USACE users should follow the approved/scanned software process described in the “Open Source Software” chapter:

Install RTools (Windows; “maybe” required)

You may need RTools on Windows when installing R packages that compile from source (C/C++/Fortran) or when your workflow requires building packages locally.

If you are unsure: install R first, then attempt to install your required packages. If package installation fails with compilation/toolchain errors, install RTools and retry.

5.3 Install and configure Positron (USACE pathway)

USACE installation path (App Portal)

For USACE-managed devices, install software through the USACE App Portal and confirm you are using an approved/scanned version.

  • Check scanned/approved versions: Finder
  • Install approved versions via the USACE App Portal

These links and the “Status Check” workflow are maintained in: Open Source Software.

After Positron is installed, do a quick verification to ensure Positron can run R successfully.

First launch checklist (R / knitr projects)

  1. Open Positron.
  2. Create or open a project folder (recommendation: one folder per analysis project).
  3. Open a new R script (for example: scratch.R).
  4. Run the following in the R console to confirm R is available:
version

You should see your installed R version printed.

If you plan to render Quarto/knitr documents locally, also confirm you can install and load common packages (your project may require additional packages):

install.packages(c("knitr", "rmarkdown", "quarto"))

If installs fail with compilation errors on Windows, revisit the RTools prerequisite.

5.4 Extensions

Positron supports many VS Code-style extensions, but the current USACE deployment via App Portal may restrict using the Extensions sidebar to search/browse an extension marketplace interactively. In practice, this may require a manual extension installation approach.

Guidance for USACE environments:

  • Keep extensions minimal and purposeful (reduce drift and support burden).
  • Prefer extensions that are widely used and actively maintained.
  • When possible, standardize extensions within a team for consistent workflows.

Install from Open VSX

Open VSX is a common source for VS Code-style extensions.

  1. Identify the extension you need and why you need it.
  2. Verify it is compatible with Positron. Not all VS Code Extensions work with Positron. See https://positron.posit.co/extensions.html
  3. Use the following code snippet to download and install the extension:
latest_version_url <- "https://open-vsx.org/api/posit/shiny/1.3.2/file/posit.shiny-1.3.2.vsix"
latest_version_filename <- basename(file.path(latest_version_url))

downloaded_vsix <- tempfile(latest_version_filename, fileext = ".vsix")

download.file(
  url = latest_version_url,
  destfile = downloaded_vsix,
  method = "curl",
  mode = "wb",
  extra = "-L"
)

system(
  paste("positron --install-extension", shQuote(downloaded_vsix))
)

For the authoritative Positron extension guidance and supported workflows, follow the vendor documentation: