Exploring apply, sapply, lapply, and map Functions in R