Examples for 'rlang::fn_env'


Return the closure environment of a function

Aliases: fn_env fn_env<-

Keywords:

### ** Examples

env <- child_env("base")
fn <- with_env(env, function() NULL)
identical(fn_env(fn), env)
[1] TRUE
other_env <- child_env("base")
fn_env(fn) <- other_env
identical(fn_env(fn), other_env)
[1] TRUE

[Package rlang version 1.1.4 Index]