Normally, this is only used in special, advanced uses. The standard approach to getting an object from an environment in the call stack is to explicitly pass it into the function.

.whereInStack(obj, startingEnv = parent.frame())

Arguments

obj

Character string. The object name to search.

startingEnv

An environment to start searching in.

Value

The environment in which the object exists. It will return the first environment it finds, searching outwards from where the function is used.