100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Installing R and RStudio

How to install R and RStudio Desktop, understand the difference between them, and navigate the RStudio IDE for the first time.

FoundationsBeginner6 min readJul 10, 2026
Analogies

Installing R and RStudio

R and RStudio are two separate pieces of software that work together: R is the actual programming language and execution engine that runs your code, while RStudio is an integrated development environment (IDE) — a graphical application made by Posit that wraps around R to give you a code editor, console, plot viewer, and package manager in one window. You must install R first, because RStudio itself does not contain a language runtime; it simply launches and communicates with whichever R installation it finds on your system.

🏏

Cricket analogy: R is like the actual match being played on the pitch, while RStudio is like the broadcast studio with replays, Snickometer, and Hawk-Eye overlays — the match (R) has to exist before the broadcast (RStudio) can show anything.

Step 1: Installing R from CRAN

R is downloaded from CRAN (cran.r-project.org), which provides platform-specific installers: an .exe installer for Windows, a .pkg installer for macOS, and repository instructions (apt, dnf, or building from source) for Linux distributions. CRAN maintains regional mirrors around the world, so most first-time users should select the '0-Cloud' mirror, which automatically redirects to a nearby, up-to-date server rather than requiring you to pick a specific country.

🏏

Cricket analogy: It's like downloading the official ICC scoring app from your regional app store rather than an unofficial third-party clone — CRAN's official installers for Windows, macOS, and Linux are the trusted 'official app store' for R.

Step 2: Installing RStudio Desktop

After R is installed, download RStudio Desktop from posit.co/downloads; the free 'Open Source Edition' is sufficient for virtually all learning and professional individual use, while paid editions add enterprise features like centralized license management. During installation, RStudio automatically detects your existing R installation, so as long as R was installed first and is on a standard path, you typically don't need to configure anything manually before RStudio opens with a working console.

🏏

Cricket analogy: It's like installing the official broadcast overlay software after the stadium's camera rig (R) is already wired in — RStudio auto-detects the existing R 'camera feed' with no manual configuration needed.

Touring the RStudio IDE

RStudio's default layout has four panes: the Source pane (top-left) for writing and editing .R script files, the Console pane (bottom-left) where code actually executes and results print immediately, the Environment/History pane (top-right) listing every variable currently in memory, and the Files/Plots/Packages/Help pane (bottom-right) for browsing your project directory, viewing generated charts, and reading function documentation. You can run a single line from the Source pane by pressing Ctrl+Enter (Cmd+Return on macOS), which sends that line to the Console without needing to retype it.

🏏

Cricket analogy: It's like a broadcast control room with four monitors: the live camera feed (Source), the commentary box (Console), the scoreboard (Environment), and the replay/stats screen (Plots/Help) — each pane has one clear job.

r
# Confirm R is installed and check its version
R.version.string
#> "R version 4.4.1 (2024-06-14)"

# Install a package from CRAN (only needs to be done once)
install.packages("ggplot2")

# Load the package into the current session (needed every session)
library(ggplot2)

# Check where RStudio thinks your R installation lives
R.home()

If you don't want to install anything locally, Posit Cloud (posit.cloud) gives you a full RStudio environment in the browser with a free tier — useful for trying R on a school Chromebook or a locked-down work laptop before committing to a local install.

Updating RStudio does NOT update R, and vice versa — they are versioned and updated completely independently. If a script suddenly needs a newer R feature, check Tools > Global Options > General in RStudio to see which R version it's actually pointing to, and update R separately from CRAN if needed.

  • R is the language/engine; RStudio is the IDE built around it — install R first, then RStudio.
  • Download R from cran.r-project.org, selecting the '0-Cloud' mirror for an automatic nearby server.
  • Download RStudio Desktop (free Open Source Edition) from posit.co/downloads.
  • RStudio auto-detects an existing R installation without manual configuration in most cases.
  • RStudio's four default panes are Source, Console, Environment/History, and Files/Plots/Packages/Help.
  • Run a line of code from the Source pane with Ctrl+Enter (Cmd+Return on macOS).
  • R and RStudio update independently of each other — check Tools > Global Options to confirm which R version RStudio is using.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#RProgrammingStudyNotes#InstallingRAndRStudio#Installing#RStudio#Step#CRAN#StudyNotes#SkillVeris#ExamPrep