An important concept when using functions in R is scope. Objects assigned in a function are local to the function and their assignment and manipulation does not affect objects from the broader calling environment. However, objects from the calling environment can be accessed and even written to from within a function. In this video we discuss these rules of scope and illustrate them. Examples in this video are drawn from Mod11Script.R. You should open
this script in RStudio and follow along, reading and submitting code as
you watch the video.
This video is essential viewing.