What is the difference between apply(), lapply(), sapply(), and tapply()?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Compare the R functions apply(), lapply(), sapply() and tapply() by what each one iterates over and what each one returns. Tests working knowledge of base R iteration, return types and grouped aggregation, along with the pitfalls that break R scripts in practice.