R Lesson 1: Install R and RStudio

📎 This article includes 1 downloadable practice file ↓

⏱ 1 min read

📘 R Beginner Course · Lesson 1 of 6

  1. Install R from cran.r-project.org.
  2. Install RStudio Desktop (free) from posit.co.
  3. Open RStudio: script editor (top left), console (bottom left), environment (top right), files/plots/help (bottom right).

Type in the console: 2 + 3, sum(c(12, 6, 2)). In a script (File › New › R Script), select lines and press Ctrl+Enter to run them.

Packages

“`r
install.packages(c(“readr”, “readxl”, “dplyr”, “ggplot2”)) # once
library(dplyr) # each session
“`

💡 Create an RStudio Project (File > New Project) in a folder with your data. File paths then just work: read_csv(“sales.csv”).

Code for this course follows standard, current syntax; we test JavaScript and PowerShell scripts before publishing, and R/Java/Rust examples are kept to core language features. Tell us if anything fails on your setup.

Practice

Install R and RStudio, create a project folder and put sales.csv in it.

📎 Practice files for this article

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong