The input string is checked as a valid environment name. The environment can be a named environment (system or package) or a user environment.
check_environment(x, envir)
string to evaluate that may represent an environment
environment where x
should be evaluated first. If it is not found there
it still searched for in the whole workspace.
A list with two elements:
found
whether the string contained in x
is the name of an existing environment
in the workspace
env_name
the name of the environment (after stripping out any system environments such
as globalenv(), baseenv() or a package environment) (for instance "globalenv()$env$env1" is returned
as "env$env1"), or NULL if no environment was found corresponding to the name given in x
.