Schedule

Course Books

Each of the below links to the full book. Icons in the schedule link to specific chapters.

Week 1

Topics
Slides
Assigned
Due
Reading
Lecture

03-29
Introduction
Weekly schedule of topics and an overview of the course requirements. We will also have an intro to data types.


03-31
Data types
We will finish up on discussing the four basic data types in depth and how coercion occurs. We will also discuss attributes, introduce lists, and discuss subsetting for lists versus atomic vectors.

Week 2

Topics
Slides
Assigned
Due
Reading
Lecture

04-05
Iteration 1
This lecture will focus on base R methods for looping, specifically with for loops and the *apply family of loops


04-07
Lab 1
Our first lab will ask you to extract elements from deeply nested lists while also using base R loops to conduct basic operations.

Week 3

Topics
Slides
Assigned
Due
Reading
Lecture

04-12
Iteration 2
Our second lecture on iteration will introduce {purrr} and contrast these functions with the base R versions. The concept of functional programming will also be discussed more explicitly.


04-14
Lab 2
The second lab will get us using {purrr} in an applied way. We’ll fit multiple models, iterate through nested lists, and make some real-world API calls.

Week 4

Topics
Slides
Assigned
Due
Reading
Lecture

04-19
Batch load data
We’ll discuss the take-home portion of the midterm and review Lab 1. We will then introduce purrr::map_df() and discuss how it can be used for batch loading data in combination with some functions from the {fs} package. This will include parsing data (as columns) from the file names. If we have time, we’ll also introduce list columns.


04-21
list columns
The concept of list columns will be introduced and contrasted with the base::split(). By the end of this lecture you should be able to fluently nest and unnest data frames and understand why this is such a powerful framework. The last 20 minutes will be devoted to an “in-class” quiz.

Week 5

Topics
Slides
Assigned
Due
Reading
Lecture

04-26
Parallel iterations
We will introduce parallel iterations (purrr::map2() and purrr::pmap()) and apply them within the context of list columns.


04-28
Looping variants
We’ll discuss the differences betweeenpurrr::map() and purrr::modify() while introducing new functions, including purrr::safely(), and purrr::walk(). We will also discuss different types of loops, focusing mostly on purrr::reduce() (and noting the similarities with base::Reduce()).

Week 6

Topics
Slides
Assigned
Due
Reading
Lecture

05-03
Writing functions 1
This is lecture is on the very basics of functions - understanding that everything in R is a function, the components of a function, when to write a function, and how to go about it (e.g., development and informal testing).


05-05
Writing functions 2
Making the internals of a function more complicated! But also keeping functions as simple as possible. Functions within functions!

Week 7

Topics
Slides
Assigned
Due
Reading
Lecture

05-10
Lab 3
The odd Monday lab day - this lab was delayed a bit so we could have a bit more of an introduction to functions before having an entire lab devoted to them. This will be the final lab for the class and will ask you to create and apply functions.


05-12
Writing functions 3
Our final lecture on functions, we will discuss what makes a function “good” and what makes them fragile. In this spirit, we will create many small functions that build toward a single function. Additionally, we the concept of non-standard evaluation will be introduced, which is used prevalently throughout the tidyverse and can make programming with the tidyverse a bit more difficult.

Week 8

Topics
Slides
Assigned
Due
Reading
Lecture

05-17
Shiny 1
The very basics of shiny - the user interface (UI) and the server. We will work together to create a basic shiny application, modifying the default template to use ggplot2.


05-19
Shiny 2
We will review the basics of shiny and introduce shiny dashboards. Different layout options will also be discussed.

Week 9

Topics
Slides
Assigned
Due
Reading
Lecture

05-24
Shiny 3
Our final lecture on shiny will focus on workflows and organization. We will discuss writing functions to help with organization. Additionally, shiny applications are somewhat notorious for being slow. If time allows, we will also discuss methods to profile your code and identify bottlenecks.


05-26
Functions and shiny review
This is a built-in day for review and to make sure we have covered the primary topics of shiny. We will also review the basics of functions. Students will be allowed to request topics for review before class.

Week 10

Topics
Slides
Assigned
Due
Reading
Lecture

05-31
Memorial day
No class


06-02
Intro to packge development
Once you are confident writing functions, it is actually not that big of a leap to wrap them all up in a package. Package development will be introduced and resources to learn more will be shared.

Week 11

Topics
Slides
Assigned
Due
Reading
Lecture

06-09
Finals Week
Your final project is due before midnight.