In R, the concept of a function within a function that retains access to the environment it was created in is called a ________.

  • Nested function
  • Closure
  • Callback function
  • Higher-order function
In R, the concept of a function within a function that retains access to the environment it was created in is called a closure. Closures are created when a nested function is defined within another function and can access the variables and objects in the parent function's environment even after the parent function has finished executing.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *