Week 2: Pipes, functions, and scripts
Lectures
- 2.1 Pipes(PDF)
- 2.2 Writing Functions(PDF)
- 2.3 R Scripts(PDF)
- add_half.R (example script)
- fib.R (example script)
- rep_even.R (example script)
Labs
Additional readings
- R for Data Science: Functions
- R for Data Science: Workflow, scripts and projects
- Tidyverse Style Guide: Pipes
- What They Forgot to Teach You About R: Project-oriented workflow
Discussion
- When is a function better than copying a pipe three times?
- What goes wrong if an analysis lives as a loose file on the Desktop instead of in an RStudio project?