Fall 2026. Universitiy of Texas at Austin, Department of Statistics and Data Sciences.

Course information

The goal of this course is to help you become comfortable using R for exploratory data analysis and basic statistical modeling. The first part of the course focuses on exploratory data analysis with tidyverse. You will learn how to wrangle data and create visualizations that effectively communicate information learned from the data. We will begin with tabular data and then extend these skills to spatial and text data. The second half of the course introduces basic machine learning algorithms, including linear and logistic regression, clustering methods, PCA, k-nearest neighbors, and tree-based models.

This is an introductory, hands-on programming course. Most classes are accompanied by a code repository and exercises that we will work through together during the class.


Logistics

Schedule

Week Date Class Slides Exercises
1 Aug 24 a Welcome
Aug 26 b Get to know Rmarkdown
Aug 28 c The big picture
2 Aug 31 a Welcome to tidyverse and tidy data
Sep 2 b Data wrangling with dplyr: basics I
Sep 4 c Data wrangling with dplyr: basics I
3 Sep 7 a Labor Day
Sep 9 b Data viz with ggplot2 I: components of the grammar of graphics
Sep 11 c Data viz with ggplot2 II: components of the grammar of graphics
4 Sep 14 a Data viz with ggplot2 III: distributions
Sep 16 b Data viz with ggplot2 IV: counts and factors
Sep 18 b Data viz with ggplot2 IV: color
5 Sep 21 a Data wrangling with dplyr: joins
Sep 23 b Data tidying with tidyr: pivot
Sep 25 c Data tidying with tidyr II: pivot
6 Sep 28 a Spatial data wrangling and visualization with sf
Sep 30 b Case study I: visualizing flight routes on the map
Oct 2 c Case study I: visualizing flight routes on the map (Cont.)
7 Oct 5 a Project 1 introduction + working day
Oct 7 b Project 1 working day
Oct 9 c Case study II: visualizing flight arrival and departure pattern
8 Oct 12 a Data wrangling with lubridate: date and time
Oct 14 b Text data with tidytext: sentiment analysis
Oct 16 c Clustering analysis I: kmeans
9 Oct 19 a Clustering analysis I: hierarchical clustering
Oct 21 b Principal component analysis
Oct 23 c Linear regression
10 Oct 26 a Linear regression (Cont.)
Oct 28 b Logistic regression
Oct 30 c K-nearest neighbor and cross validation
11 Nov 2 a tidymodels: Linear regression, logistic regression, and KNN
Nov 4 b tidymodels: Linear regression, logistic regression, and KNN (Cont.)
Nov 6 c Regression and classification tree
12 Nov 9 a Random forest
Nov 11 b Project 2 introduction + working day
Nov 13 c Project 2 working day
13 Nov 16 a Case study III: Classifying U.S. flights: regional vs. mainline operations
Nov 18 b Case study III: Classifying U.S. flights: regional vs. mainline operations (Cont.)
Nov 20 c Webscraping with rvest
14 Nov 30 a Case study IV: visualizing paid vacation by country
Dec 2 b Mini research presentation
Dec 4 c Animation and interactive graphics
15 Dec 7 a Project 2 working day


Assessment

Week Tuesday 11:59pm Thursday 11:59pm
3 Lab 1
4 Lab 2 HW 1
5 Lab 3 HW 2
6 Lab 4 HW 3
7 Lab 5
8 Lab 6
9 Lab 7 Project 1
10 Lab 8 HW 4
11 Lab 9 HW 5
12 Lab 10 HW 6
13 Lab 11 Project 2 prelim
15 Project 2

Extra credit – Mini research opportunity (3-5 marks)

I’d like to let you know about a bonus mark opportunity for this class: a 10-minute presentation in Week 13 or 14 on an advanced topicrelated to what we have covered, but not formally taught.

Think of it as a mini research project where you explore something new, based on what you’ve learnt in the class, with my guidance. If you find a particular topicinteresting, or if you’d like to dip your toes into research, this is a low-cost opportunity to try!

What you need to do:

  • Pick one item from the topiclist (more will be added) and email me to register your interest. Topics will be assigned on a first-come, first-served basis. Additional topics will be provided if more people sign up. You can also propose a topicyou’re interested in but not covered in the class.

  • After I confirm your choice, you can begin investigating the problem. I’m happy to meet during the week to discuss and provide guidance, but I can’t walk you through the solution - since this is meant as a research component, you need to develop it yourself.

  • Prepare your findings in a presentation to share with the class in week 13 or 14 (TBD).

Depending on the quality of your investigation, you can earn an additional 3-5 marks toward your final grade.

Topic list:

Project Description
Quarto 1 We have been using R Markdown files throughout the semester, but in recent years, Posit has introduced a new format called Quarto. The two are similar, but Quarto allows for additional features. Create some demonstrations to show your classmates what is the same and what is different in Quarto and R Markdown.
Quarto 2 In Week 1 Wednesday, we mentioned that R Markdown/Quarto can be used for many purposes, such as creating slides, building websites, and writing books. Using the official Quarto documentation and other resources, create a simple personal website for yourself and show your classmates how to do so.
leaflet We introduced plotting spatial data on Week 5 cday. Leaflet, originally developed in JavaScript, is another popular choice to visualize spatial data by news agencies (e.g. The New York Times). Focusing on the R package leaflet, show your classmates how the mapping grammar works in leaflet and how to use it with sf objects and other spatial data objects.
Spatial join and filter We have talked about joining (dplyr::*_join()) and filtering (dplyr::filter()) for tabular data - but how do you perform joins or filters on spatial data? For example, how would you find all the airports in Texas? Create some examples to show your classmates the functionalities in sf for spatial join and spatial filter.
tidygraph In the flight case study (Week 6 cday), we plot a map with airports as nodes and flight routes as edges. This is a graph structure. In R, there is a package called tidygraph that provides a tidy data interface to work with network data. Create some examples to demonstrate how to wrangle and visualize network data using the tidygraph and related package.


Textbooks