The topic of this week is functions, environment, and apply family in R. We first cover the method of defining your own function in R, then we bring in the concept of environment since they are relevant. At last, we go over the apply family. Recall that we learned loops as one of the basic concepts at the very beginning; you can review it from the Starter Kit and the Lab featuring More Fundamentals. Although loop is conceptually simple and intuitive, it is inefficient. The apply family comes in handy in this case.
Here is the link to our open lab’s GitHub repository: https://github.com/wbh0912/R-Open-Lab-Fall-2018/blob/master/function%2C%20environment%2C%20apply.R
If you have further questions regarding topics covered in the material, please feel free to drop in during consultation hours or leave a comment.