This is a wrapper around environment with a consistent syntax.

enclosing_env(f)

Arguments

f

The name of a function.

Examples

enclosing_env("plot")
#> <environment: namespace:base>
enclosing_env("t.test")
#> <environment: namespace:stats>