Learning Objectives

This week, students will:

  • Learn the structure of loops

Practice Objectives

  • Vectorized functions
  • Creating functions

Review

methods(is)
methods(summary)
methods(summarize)

Setup your RStudio project (5 min)

Day 1

Looping by values in an object

Looping by index

Storing results from loops

Looping over multiple objects

Day 2

Looping using functions

Exercise 6: Mass of dinosaurs with loops (30 min)

Looping over files

Practical uses of for loops

Exercise 7: Automatic analysis of muliple files (30 min)