R Lesson 1: Install R and RStudio

R Lesson 1: Install R and RStudio featured illustration

πŸ“Ž This article includes 1 downloadable practice file ↓

⏱ 1 min read

πŸ“˜ R Beginner Course Β· Lesson 1 of 6

Advertisement
In this article
  1. Packages
  2. Practice
  3. Continue learning
  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

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.

Advertisement

πŸ“Ž 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