Explain the concept of lexical scoping in R and how environments affect variable access within functions
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how lexical scoping works in R and how environments decide which value a function sees when it uses a name it did not define. Tests knowledge of enclosing environments, closures, the super-assignment operator and the difference from dynamic scoping.