Schedule
Course Books
Each of the below links to the full book. Icons in the schedule link to specific chapters.
Advanced R: Second Edition
R for Data Science
Mastering Shiny
Happy git with R
Other content not in the course books
R for Data Science
Mastering Shiny
Happy git with R
Other content not in the course books
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
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.
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 betweeen
purrr::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).
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.
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
Week 11
Topics
Slides
Assigned
Due
Reading
Lecture