R

Published

26 January 2026

Installation

Normal Setup

R must be installed before installing RStudio

  1. R Download — The Comprehensive R Archive Network

  2. RStudio Download —Posit.co

OR

2. Positron — Posit.co

Development Setup for Compling Packages (Extra)

  • Windows — RTools

    • Use installation instructions on package website or use this alternative method: installr package (CRAN site)

      • installr::install.Rtools()
  • macOS — Xcode Command Line Tools (See guide for Terminal commands)

Using R Online

Publishing

  • Quarto should be downloaded as a binary from its website for installation.

  • Exporting (Knitting) from RMarkdown or Quarto requires a LaTeX installation.

  • Easy method (Works in most cases)

  • Advanced (Works in all cases, but difficult to manage)

Videos

Handouts

RMarkdown Tables (Old Version)

External Resources

R

R Courses

RMarkdown

Regular Expressions

Data Types

  • Vector

    • Dimensions: 1D

    • Homogeneous?: Yes

    • Key use case: Basic data storage

  • List

    • Dimensions: 1D (nested possible)

    • Homogeneous?: No

    • Key use case: Collection of various data types

  • Matrix

    • Dimensions: 2D

    • Homogeneous?: Yes

    • Key use case: Mathematical operations

  • Data Frame

    • Dimensions: 2D

    • Homogeneous?: No (columns can be different)

    • Key use case: Tabular data analysis

  • Array

    • Dimensions: 2D or more

    • Homogeneous?: Yes

    • Key use case: Multi-dimensional data

Miscellaneous

  • DAGitty for Directed Acyclic Graphs

  • Styling code using Tidyverse style guide with styler package.

    • See also lintr for error checking.

    • styler can be used before lintr to reduce errors marked.

    • lintr can set a style guide using the command lintr::use_lintr(type = “tidyverse”)