Whys and Hows of Apply Family of Functions in R