Lecture 9
Duke University
STA 199 - Fall 2026
September 28, 2026
Did you get my Week 5 nudge email?

Go to wooclap.com and use the code IQYBPOT.
HW 4 due Wednesday β last homework before the exam
Exam 1 covers everything up to and including the material in next Mondayβs lecture, but Mondayβs lecture is catch-up + review (so effectively up to and including the material in this Wednesdayβs lecture)
ae-05-survey-typesGo to your ae project in Positron.
Continue working in last weekβs application exercise file: ae-05-survey-types.qmd.
Work through the application exercise in class, and render, commit, and push your edits by the end of class.
read_csv()read_tsv(), read_delim(), etc.read_excel()read_sheet() β We havenβt covered this in the videos, but might be useful for your projectsread_csv()read_csv() - filefile = "data/survey.csv", or a URL.read_csv() - naread_csv() - quoteread_csv() - skipskip or not to skip?For example, temperatures.csv has a metadata block before the table:
skip or not to skip?Warning: One or more parsing issues, call `problems()` on your data frame for details,
e.g.:
dat <- vroom(...)
problems(dat)
Rows: 4 Columns: 2
ββ Column specification ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Delimiter: ","
chr (2): Weather station: Durham, NC
βΉ Use `spec()` to retrieve the full column specification for this data.
βΉ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 4 Γ 2
`Weather station: Durham` NC
<chr> <chr>
1 Temperature units: Celsius <NA>
2 date temperature
3 2026-09-21 24
4 2026-09-22 22
skip or not to skip?Rows: 2 Columns: 2
ββ Column specification ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Delimiter: ","
dbl (1): temperature
date (1): date
βΉ Use `spec()` to retrieve the full column specification for this data.
βΉ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 2 Γ 2
date temperature
<date> <dbl>
1 2026-09-21 24
2 2026-09-22 22
read_csv() - n_maxread_csv() - guess_maxread_csv() - name_repair"unique" fixes empty or duplicated names.age become age...1 and age...2."universal" also makes names valid without backticks.Read an Excel file, with all its Excel-ness
Split it into subsets based on features of the data
Write out subsets as CSV files
Identify and articulate one feature of the data based on this visualization.

ae-06-age-gaps-importGo to your ae project in Positron.
If you havenβt yet done so, make sure all of your changes up to this point are committed and pushed, i.e., thereβs nothing left in your source control pane.
If you havenβt yet done so, pull to get todayβs application exercise file: ae-06-age-gaps-import.qmd.
Work through the application exercise in class, and render, commit, and push your edits by the end of class.