CHAPTER 02
Beginner
Installing R and RStudio
Updated: May 18, 2026
5 min read
# CHAPTER 2
Installing R and RStudio
1. Chapter Introduction
A properly configured R environment is the foundation of productive data science work. This chapter installs R, configures RStudio, and verifies the complete setup — from first launch to installing the tidyverse.2. Installing R
text
3. Installing RStudio
text
4. RStudio Interface
text
5. Your First R Script
r
6. Installing and Loading Packages
r
7. R Projects (Best Practice)
r
8. Common Mistakes
-
Using
=instead of<-for assignment: In R, the convention isx <- 5. While=also works,<-is standard R style and avoids ambiguity inside function calls.
-
Forgetting
library()after installation:install.packages()downloads the package once. You must calllibrary(package)at the start of every R session to use it.
9. MCQs
Question 1
R is downloaded from?
Question 2
RStudio Source Editor is where you?
Question 3
library(ggplot2) does?
Question 4
install.packages() needs to be called?
Question 5
R assignment operator convention?
Question 6
getwd() returns?
Question 7
Ctrl+Enter in RStudio runs?
Question 8
RStudio Environment panel shows?
Question 9
R Projects (.Rproj) provide?
Question 10
?mean in console opens?
10. Interview Questions
-
Q: What is the difference between
install.packages()andlibrary()?
-
Q: Why are R Projects recommended over
setwd()?
11. Summary
Install R from CRAN, RStudio from Posit. RStudio 4-panel layout: Source (scripts), Console (REPL), Environment (objects), Files/Plots/Help. Assignment operator:<-. Package workflow: install.packages() once, library() every session. Use R Projects for reproducible directory management. Install tidyverse as the essential data science suite.