10.4 Fundamentals - Environment

  • Environment when function is created defines arguments in the function
  • Use env_print(fun) and fn_env() to explore
env_print(square)
#> <environment: 0x560e52d77cc8>
#> Parent: <environment: global>
#> Bindings:
#> • exp: <lazy>
fn_env(square)$exp
#> [1] 2
Blue indicates environment, arrows bindings
Blue indicates environment, arrows bindings