7.7 Quiz answers

  1. There are four ways: every object in an environment must have a name; order doesn’t matter; environments have parents; environments have reference semantics.

  2. The parent of the global environment is the last package that you loaded. The only environment that doesn’t have a parent is the empty environment.

  3. The enclosing environment of a function is the environment where it was created. It determines where a function looks for variables.

  4. Use caller_env() or parent.frame().

  5. <- always creates a binding in the current environment; <<- rebinds an existing name in a parent of the current environment.