Introduction
Use lapply and sapply to run a function on each item in a list or vector easily. They help you avoid writing loops.
You want to apply the same calculation to every item in a list.
You have a vector and want to transform each element quickly.
You want to get results back as a list or a simpler vector/matrix.
You want cleaner, shorter code instead of writing loops.
You want to process data step-by-step in a functional style.