
π This article includes 1 downloadable practice file β
In this article
- Install R from cran.r-project.org.
- Install RStudio Desktop (free) from posit.co.
- 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.
π Practice files for this article
- π§Ύsales.csv40 sample orders used by the scripts.β¬ CSV Β· 1 KB
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