What is the difference between if/else and the vectorised ifelse() in R?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Explain how R's if/else control flow differs from the vectorised ifelse() function. Tests whether you know what each accepts and returns, how they treat long or missing conditions, which branches get evaluated, and the type pitfalls that make stricter alternatives useful.