Here, we define that as .GlobalEnv, any namespace, emptyenv, or baseenv. This is useful to determine the effective size of an R function, due to R including the objects from enclosing environments

isTopLevelEnv(x)

Arguments

x Any environment

Value

A logical. FALSE if it is not one of the "Top Level Environments", TRUE otherwise.