Honeycomb hex patterns. Photo by Shilo Labelle on Unsplash.
Instructor
Allison Horst (ahorst@ucsb.edu)
Teaching Assistant
Yutian Fang (yutianfang@umail.ucsb.edu)
Important links
Course description
In EDS 221, students will build key scientific programming skills essential for environmental data analysis and problem solving in R. Topics include structured programming and algorithm development, iteration, conditionals, functions and objects, documentation, testing and troubleshooting, tidy data structure, and an introduction to data wrangling and visualization.
Learning objectives
By the end of EDS 221, students should be able to:
Understand, create, and work with different data structures (e.g. vectors, data frames, lists) and types (e.g. numeric, character, factor, logical, date-times)
Design, implement, test and document functions (including functions with iteration, conditionals, messages and warnings) in R
Use basic (non-collaborative) project-oriented workflows with reproducible code (R scripts, R Markdown, Quarto documents) and version control (git/GitHub basics)
Perform basic data wrangling and visualization with real world environmental data with tidyverse packages (in R)
Employ troubleshooting and debugging strategies (tools, mindsets, strategies, resources)
Predictable daily schedule
Course dates: Monday (2023-08-14) - Friday (2023-08-18)
EDS 221 is an intensive 2-week long 4-unit course. Students should plan to attend all scheduled sessions. All course requirements will be completed between 10am and 4:30pm PST (M - F), i.e. you are not expected to do additional work for EDS 221 outside of those hours, unless you are working with the Teaching Assistant in student hours.
Tentative daily schedule (subject to change):
10:00am - 11:00am |
Lecture 1 |
11:15am - 12:30pm |
Interactive Session 1 |
12:30pm - 1:30pm |
Lunch |
1:30pm - 2:15pm |
Lecture 2 |
2:15pm - 3:00pm |
Interactive Session 2 |
3:00pm - 4:30pm |
Activities |
Expected sessions (subject to change)
Note: lectures and flex sessions will also often include interactive live-coding. You should bring your computer and charger to all sessions in EDS 221.
Monday 8/14: morning |
- “Hello, world”: course introduction, programming in EDS, meet our tools
|
Don’t fear the Terminal - continuing with some commands, navigation, and more git |
N/A |
Monday 8/14: afternoon |
- Project oriented workflows, file paths, naming things,good habits from the tidyverse style guide
|
Meet here , project organization, adding data import to our workflow |
Day 1 Activities - Handout |
Tuesday 8/15: morning |
- Data representation and types
|
Creating and indexing with different data types |
N/A |
Tuesday 8/15: afternoon |
- Common data types and structures in EDS
|
Data in R, accessing / updating elements & casting continued |
Day 2 Activities - Handout |
Wednesday 8/16: morning |
- Conditionals and logical operations, intro to for loops
|
Refresh logical operations, write basic for loops in R |
N/A |
Wednesday 8/16: afternoon |
- Loops continued - and functions to help
|
For loops with conditions, apply() functions, and across()
|
Day 3 Activities - Handout |
Thursday 8/17: morning |
- Introduction to writing functions in R and Python
|
Functions 101: basics |
N/A |
Thursday 8/17: afternoon |
- Functions continued: planning, adding useful messages, more advanced functions and outputs
|
Functions 102: beyond basics (functions with conditions, iteration, messages) |
Day 4 Activities - Handout |
Friday 8/18: morning |
- Functions continued: testing, documentation, sharing
|
Functions 103: testing & documenting functions, making your first package |
N/A |
Friday 8/18: afternoon |
- Finding & using external packages
|
Find & explore packages, documentation, accessing from repos |
Day 5 Activities - Handout |
Monday 8/21: morning |
- Tidy data: what, why, how?
|
Tidying data (pivot, separate) basics with tidyr and pandas |
N/A |
Monday 8/21: afternoon |
- Data tidying and wrangling continued:
dplyr and pandas
|
Data wrangling continued - dplyr and pandas |
Day 6 Activities - Handout |
Tuesday 8/22: morning |
- Data wrangling continued - more tidying, relational data & types of joins
|
Data wrangling continued: joins |
N/A |
Tuesday 8/22: afternoon |
- Data wrangling continued - working with dates & times, wrangling strings
|
Data wrangling continued: dates, times, strings |
Day 7 Activities - Handout |
Wednesday 8/23: morning (late start) |
- The grammar of graphics & basic graph considerations
|
Fork this repo to follow along with Data visualization in ggplot2
See also: Ced Scherer’s ggplot2 tutorial, and Yan Holtz’ From Data to Vis and R Graph Gallery |
N/A |
Wednesday 8/23: afternoon |
- Data visualization basics - responsible, clear, awesome
|
Data viz continued |
Day 8 Activities - Handout |
Thursday 8/24: morning |
- Troubleshooting 101
|
Teach Me How to Google Workshop (Sam Csik) |
N/A |
Thursday 8/24: afternoon |
- kable tables, and alt-text
|
More wrangling tools and practice, kable tables |
Day 9 Activities - Handout |
Friday 8/25: morning |
R package revisited, tables in R, a taste of git collaboration |
.N/A |
Morning activity - handout |
Friday 8/25: afternoon |
Course wrap-up |
N/A |
Afternoon Activity - handout |
Course requirements
Computing
About this website
This website was created with gratitude using distill from RStudio by JJ Allaire, Rich Iannone, Alison Presmanes Hill, and Yihui Xie.
This website is one piece of the EDS 221 course materials in addition to lectures, computational activities, discussions, and individual and group tasks, and important materials may exist partially or not at all on this site. While this website is public, it is not meant as a standalone online course.
Other packages used to create this website:
rmarkdown
for…pretty much everything: JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone (2021). rmarkdown: Dynamic Documents for R. R package version 2.7. URL https://rmarkdown.rstudio.com