What is the MARGIN argument in apply() and how does it control row versus column operations?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks what the MARGIN argument of R's apply() function does and how it switches between row-wise, column-wise and element-wise operations. Tests understanding of matrix dimensions, the shape of the returned result, and faster built-in alternatives.