Installation & Tooling
2.1 Install R
All platforms: download from CRAN (cran.r-project.org).
Windows: winget install RProject.R (and optionally Rtools for compiling packages).
macOS: brew install --cask r (also install Xcode command-line tools for compiling).
Ubuntu: sudo apt install r-base r-base-dev (or the CRAN Ubuntu repository for the latest version).
rig (R Installation Manager) manages multiple R versions: rig add release, rig list, rig default 4.5.
R --version2.2 IDEs
RStudio (Posit) the classic R IDE: console, editor, environment pane, plots, help, Git, projects Positron (Posit) next-generation data science IDE (VS Code-based), R + Python with the R extension + languageserver package via the IRkernel ESS (Emacs Speaks Statistics) webR / Posit Cloud R in the browser
2.3 Running R
R # interactive console
Rscript script.R # run a script
Rscript -e 'print(1+1)' # run an expression
R CMD BATCH script.R # batch mode with .Rout log