Home | R | Python | Stata
Coding Smartly

Speaking R

The R Environment (Downloading R and RStudio; RStudio interface; Working directory; Objects)
R Commands (Using R as a calculator; Print; R commands; Comments; Packages; Getting help)
Writing R Code (Being reproducible; Organizing code; Syntax; Miscellaneous)

Data Structures

Data Structures (Factors; Matrices and Arrays; Lists; Data frames)
More on Subsetting (Storing temporary outputs; Modifying object elements; subset(); %in% operator)
Working with JSON Data (JSON objects; JSON arrays; Nested JSON objects; JSON files)

Control Flow

Conditional Statements (if; if ... else if; if ... else if ... else; if ... else; Nested if; Vectorized ifelse())
Loops (for loops; Nested loops; while loops; break; next)


Functions (Creating and calling functions; Arguments; Returning values; stop(); Recursive functions; Nested functions; Scope of variables)

Exploring Data

Reading Data (Importing data with RStudio; Reading rectangular text data; Reading data from other software; Reading data of JSON format; Working with databases)
A Glimpse of Your Data (Summary statistics; Exploratory data analysis)

Data Manipulation

Apply Family Functions (apply(); tapply(), by(); lapply(), sapply(), mapply())
Data Transformation (Recoding variables; Adding/dropping columns and rows; Renaming variables; Arranging rows; Reordering columns; Grouping; Removing duplicates)
Aggregating Data (dplyr functions; data.table functions)
Reshaping Data from Long/Wide to Wide/Long Formats (spread(); gather(); pivot_wider(); pivot_longer(); dcast(); melt())
Spreading Rows (Filling in values; Replicating rows)
Duplicates (Finding and marking duplicates; Finding the positions of duplicates; Removing duplicates)

Dates and Times

Dates and Times Fundamentals (Data types; Converting dates and times; Creating dates and times; Extracting date-time components; Calculations; Time zones)


Strings (Regular expressions; Pattern searching, matching and replacement; grep(), grepl(); sub(), gsub(); stringr functions)


A Lot of Bars (Stacked bars (count); Stacked bars (percentage); Grouped bars; Lollipop chart)
Grouping in Plotting (Coloring; Facets; Grouped bars; Combining graphs)

Web-interfacing Visualization with Shiny App

Project I: Exploring multiple dimensions of survey data

Project II: Visualizing times and locations with animation and interactivity

Working with SQL in Shiny

Project I: Building a one-stop-shop web app for business intelligence

Project II: Buildng a prototype of a database management system

Recommended Resources