Week 8 Overview
This wraps up the content for week 7. Now we require some practice! You should head back to our Moodle site to check out your assessment for this week.
This week we’ll start off with a recap, and then introduce the apply()
functions from Base R, and the (mostly) equivalent tidyverse options from the purrr
package. We will then get into advanced function writing and querying APIs.
Week 8 Additional Readings/Learning Materials
apply()
family and Function Material
Advanced R Chapters
purrr
Week 8 Learning Objectives
Upon completion of this week, students will be able to:
write an R function that has default arguments, allows for additional arguments, and returns a well-structured named object
- determine appropriate uses for the stop function
- develop a pipeable function that acts on a data frame and one that produces side effects
- create a custom infix function
- determine appropriate uses for the stop function
define environments including temporary environments
- summarize the order in which R attempts to find a requested object
- sketch out the R environment framework and explain the idea of lexical scoping
- discuss the concept of local variables and local environments as compared to global variables and environments
- state the naming conventions for R objects
- summarize the order in which R attempts to find a requested object
program using the “apply family” of functions and the purrr packing in R
- differentiate between the apply family of functions in R including, but not limited to, mapply, sapply, lapply, apply, and replicate
- manipulate R code that uses loops to instead use the proper apply function
- utilize anonymous functions in calls to the apply family of functions in R
- use functions from purrr to perform data manipulations
- differentiate between the apply family of functions in R including, but not limited to, mapply, sapply, lapply, apply, and replicate
describe what an anonymous function is and how it differs from other functions
Use the table of contents on the left or the arrows at the bottom of this page to navigate to the next learning material!