env_depth

0th

Percentile

Depth of an environment chain

This function returns the number of environments between env and the empty environment, including env. The depth of env is also the number of parents of env (since the empty environment counts as a parent).

Usage
env_depth(env)
Arguments
env

An environment or an object bundling an environment, e.g. a formula, quosure or closure.

Value

An integer.

See Also

The section on inheritance in env() documentation.

Aliases
  • env_depth
Examples
# NOT RUN {
env_depth(empty_env())
env_depth(pkg_env("rlang"))
# }
Documentation reproduced from package rlang, version 0.1.6, License: GPL-3

Community examples

Looks like there are no examples yet.