This is a wrapper around environment with a consistent syntax.
environment
enclosing_env(f)
f
The name of a function.
enclosing_env("plot") enclosing_env("t.test")