We heard the term vectorized earlier when we talked about operating on vectors without using loops. While looping is a great way to iterate through vectors and perform computations, it is not very efficient when we deal with what is known as Big Data. In this case, R provides some advanced constructs which we will be looking at in this section. We will be covering the following functions:
lapply: Loops over a list and evaluates a function on each element
sapply: A simplified version of lapply
apply: Evaluates a function on the boundaries or margins of an array
tapply: Evaluates a function over subsets of a vector
mapply: A multivariate version of lapply
Like we mentioned earlier,
lapply takes a list and a function ...