In this session, the students will be introduced to functions in R and how they can be used to extend the functionalities of R. The students will be introduced to what functions are and how to create their own functions for specific computing and statistical analysis tasks that they require.
Further Reading
Wickham H and Grolemund G. Functions. In R for Data Science. https://r4ds.had.co.nz/functions.html
Myatt M. Exercise 2 - Manipulating objects and creating new functions. In Practical R for Epidemiologists. https://practical-r.org/exercise2.html
Teaching Material
Slides can be viewed here.
PDF version of slides can be downloaded here.
R scripts for slides available here.