Lecture 1 / 12
Lecture 01 ยท Fundamentals

Introduction to R & Setup

Beginner ~45 min

What is R?

R is a powerful open-source language and environment for statistical computing, data analysis, and visualization. It is widely used in academia, data science, bioinformatics, and industry.

Why R?

  • Best-in-class tools for statistics and data visualization
  • Thousands of specialized packages (CRAN)
  • Excellent for exploratory data analysis
  • Strong integration with Python (reticulate) and databases

Installation

Download R from cran.r-project.org and RStudio (recommended IDE) from posit.co.

R Console
> print("Hello, R Mastery!")
[1] "Hello, R Mastery!"

> version$version.string
[1] "R version 4.4.1 (2024-...)"
๐ŸŽฏ Exercise 1.1

Install R and RStudio. Create a new script and run code that prints your name, today's date, and the result of 17 * 23.

Lecture 02 ยท Fundamentals

Variables & Data Types

Beginner ~45 min

Assignment Operator

In R, we typically use <- for assignment.

x <- 42
name <- "R Student"
is_valid <- TRUE
Lecture 03 ยท Fundamentals

Operators & Expressions

Beginner ~40 min

Basic Math

5 + 10
10 / 2
2 ^ 3 # Power
Lecture 04 ยท Fundamentals

Control Flow

Beginner ~45 min

If Statements

if (x > 10) {
    print("Large")
} else {
    print("Small")
}
Lecture 05 ยท Fundamentals

Loops & Functions

Beginner ~50 min

For Loops

for (i in 1:5) {
    print(i)
}
Lecture 06 ยท Core Concepts

Data Structures & Vectors

Intermediate ~55 min

Creating Vectors

v <- c(1, 2, 3, 4, 5)
v * 2 # Vectorized operation
Lecture 07 ยท Core Concepts

Data Frames & dplyr

Intermediate ~65 min

The Pipe Operator

df %>%
    filter(age > 18) %>%
    select(name, salary)
Lecture 08 ยท Core Concepts

Data Import & Cleaning

Intermediate ~50 min

Learn how to read CSV and Excel files and clean messy data using tidyr.

Lecture 09 ยท Advanced

Visualization with ggplot2

Advanced ~70 min

Grammar of Graphics

ggplot(data = df, aes(x = age, y = height)) +
    geom_point() +
    geom_smooth(method = "lm")
Lecture 10 ยท Advanced

Statistical Analysis

Advanced ~60 min

Performing hypothesis testing and correlation analysis in R.

Lecture 11 ยท Advanced

Advanced Data Manipulation

Advanced ~60 min

Using purrr for functional programming and stringr for text processing.

Lecture 12 ยท Capstone

Capstone Project: Data Analysis

Advanced ~180 min

Perform an end-to-end data analysis on a real-world dataset, from cleaning and exploration to modeling and visualization.

# Project goals:
# 1. Load and clean a dataset
# 2. Perform exploratory data analysis (EDA)
# 3. Create publication-quality plots
# 4. Build a predictive model