Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
The lapply() function
Other apply() functions
The split-apply-combine pattern
19. The unlist() function


Calling lapply() returns a list. This list however, can be simplified to a vector or a data frame by calling the unlist() function, which takes a list as input and returns a vector or data frame.

So if you apply the unlist() function on a result that was returned by lapply(), you will get the exact same result as that of simply using sapply().


Use the unlist() function on the sum_of_pieces variable created in the previous exercise. Observe the result.