Instruction: Explain how you would use higher-order functions in R to abstract a pattern of computation. Provide an example using a scenario where repetitive tasks need to be abstracted.
Context: This question tests the candidate's understanding of functional programming principles in R, including the use of higher-order functions like lapply, sapply, or custom function generators. The response should show how these concepts can be used to write clean, efficient, and reusable code.