R/func.R
locals.Rd
Return all symbols in the specified environment as list.
locals(without = c(), env = parent.frame())
Character vector. Symbols from current env to exclude.
Environment to use. Defaults to the environment from which locals is called.
locals
Specified environment as list (without the mentioned symbols).
f <- function() { x <- 1 y <- 2 z <- 3 locals() } ret <- f() stopifnot(identical(ret, list(z = 3, y = 2, x = 1)))