The name argument can specify the environment from which
object names are taken in one of several forms:
as an integer (the position in the search list); as
the character string name of an element in the search list; or as an
explicit environment (including using
sys.frame to access the currently active function calls).
By default, the environment of the call to ls or objects
is used. The pos and envir arguments are an alternative
way to specify an environment, but are primarily there for back
compatibility.
Note that the order of strings for sorted = TRUE is
locale dependent, see Sys.getlocale. If sorted =
FALSE the order is arbitrary, depending if the environment is
hashed, the order of insertion of objects, ….