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…
In this video we introduce functions in R and how to write them. We begin with functions of a single argument, using a truncation function as an example. Then we proceed to illustrate how to return…