equal_environments: Equal environments.

Description Usage Arguments Details Value

View source: R/equal_environments.R

Description

This function will check if two environments are equal enough to be considered interchangeable, i.e. with regard to having them attached to the search-path.

Usage

1
equal_environments(env1, env2)

Arguments

env1

The first environment to investigate

env2

The second environment to investigate.

Details

This function is mainly intended as a helper-function for options_attach, and its present incarnation does not go deep into the internal hierarchy of the environments. The procedure starts out by testing if the environments are identical, and if not it looks into them to see if they contain the exact same content. If the main environments contains environments themselves, then the test will only check if these are identical. It's possible to use an iterative algorithm, but that would require the addition of a safeguard against infinite recursions.

Value

The result of this function will be either TRUE or FALSE, with an attribute identical that reveals the result of the identical test.


LAJordanger/leanRcoding documentation built on Feb. 27, 2020, 4:42 p.m.