R

R is a statistical programming language, and is highly optimized for that purpose (though additional functionality exists). It can be relatively slow and doesn’t use memory particularly effectively, but it has a wide variety of data analysis and statistical modeling functions and libraries. R syntax is a bit different than other languages, but you may collaborate with people who prefer to work in R, so it’s good to know your way around it.

Installation

Use the latest version of R that you can, but it’s not essential (usually) to stay on top of updates. R can be managed using conda, but conda only packages a subset of CRAN. It’s still generally good practice to create new environments for different projects.

For project-level reproducibility in R, renv is the standard tool: it records the exact package versions a project uses in an renv.lock file that you commit alongside the code. Use it for anything that will end up in a paper.

Usage

Hadley Wickham has several good (and freely available online!) R books, depending on your level of familiarity:

Kieran Healy has an excellent book on data visualization using the ggplot2 library, which pairs well with our figure design guide.

Development Environments

RStudio is the best graphical R IDE around. It is now developed by Posit, the company formerly called RStudio, but the editor itself is unchanged and still free and open-source.

If you would rather stay in one editor across languages, VS Code has a usable R extension, though RStudio remains the better experience for R-heavy work.