parenv: Get parent/ancestor environment

Description Usage Arguments Examples

View source: R/parenv.r

Description

Get parent/ancestor environment

Usage

1
parenv(env = parent.frame(), n = 1)

Arguments

env

an environment

n

number of parents to go up

Examples

1
2
3
adder <- function(x) function(y) x + y
add2 <- adder(2)
parenv(add2)

Example output

<environment: R_GlobalEnv>

pryr documentation built on May 2, 2019, 9:58 a.m.