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-28
Introduction & data tyes
Weekly schedule of topics and an overview of the course requirements. We will discuss 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-04
Intro to iterations & Lab 1
This lecture will focus on base R methods for looping, specifically with for loops and the *apply family of loops. 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-11
Iterations 2 & Lab 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. 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-18
Batch load data & list columns
We will 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. The concept of list columns will be introduced and contrasted with 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-25
Parallel iterations & looping variants
We will introduce parallel iterations (purrr::map2() and purrr::pmap()) and apply them within the context of list columns. 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-02
**REMOTE ONLY** Writing functions 1 & 2
The first part of this lecture will focus 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). We will then extend this discussion toward making the internals of a function more complicated, while still keeping functions as simple as possible. Functions within functions!

Week 7

Topics
Slides
Assigned
Due
Reading
Lecture

05-09
Writing functions 3 & Lab 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 will discuss the concept of non-standard evaluation, which is used prevalently throughout the tidyverse and can make programming with the tidyverse a bit more difficult. We will also have our final lab for the class, which will ask you to create and apply functions.

Week 8

Topics
Slides
Assigned
Due
Reading
Lecture

05-16
Shiny 1 & 2
Please clone the course repo of example apps before class.We will start by introducing 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. Shiny dashboards and different layout options will also be discussed.

Week 9

Topics
Slides
Assigned
Due
Reading
Lecture

05-23
Shiny 3 & review
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. 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-30
Memorial day
No class - if you feel so inclined, you can watch last year’s lecture introducing package development

Week 11

Topics
Slides
Assigned
Due
Reading
Lecture

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