This script was adapted from Tanya Rogers, who adapted it from Umi Hoshijima, who adapted it from Software Carpentry!

This is a short tutorial on writing functions in R by An Bui with help from Juliette Verstaen and Sam Csik.

1. What do functions do?

Functions allow you to ‘do’ things in R. There are 3 basic parts to handling a function: