get_environment: List objects in stack frame

Description Usage Arguments Details Examples

View source: R/rinside.R

Description

Useful for debugging sessions.

Usage

1
get_environment(which = 1, exclude = NULL)

Arguments

which

integer. the frame number in the call stack.

exclude

character. which arguments should be excluded? It is possible to exclude some variables by name.

Details

Returns all variables in a call environment. Made it possible with sys.frames(), which accesses to the environments in the call stack.

Examples

1
2
3
4
5
6
7
## Not run:  
e <- function() {x<-"A";y<-rnorm(5);get_environment()};e()
## inline functions:
ei <- function() {x<-"A";y<-rnorm(5); function() {get_environment(2)}}
ei()

## End(Not run)

strboul/mmy documentation built on Sept. 24, 2021, 12:08 p.m.