EVOLUTION-MANAGER
Edit File: env_bury.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Mask bindings by defining symbols deeper in a scope</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for env_bury {rlang}"><tr><td>env_bury {rlang}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Mask bindings by defining symbols deeper in a scope</h2> <h3>Description</h3> <p><a href="https://lifecycle.r-lib.org/articles/stages.html#superseded"><img src="../help/figures/lifecycle-superseded.svg" alt='[Superseded]' /></a> </p> <p>This function is superseded. Please use <code><a href="env.html">env()</a></code> (and possibly <code><a href="get_env.html">set_env()</a></code> if you're masking the bindings for another object like a closure or a formula) instead. </p> <p><code>env_bury()</code> is like <code><a href="env_bind.html">env_bind()</a></code> but it creates the bindings in a new child environment. This makes sure the new bindings have precedence over old ones, without altering existing environments. Unlike <code>env_bind()</code>, this function does not have side effects and returns a new environment (or object wrapping that environment). </p> <h3>Usage</h3> <pre> env_bury(.env, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>.env</code></td> <td> <p>An environment.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p><<a href="dyn-dots.html">dynamic</a>> Named objects (<code>env_bind()</code>), expressions <code>env_bind_lazy()</code>, or functions (<code>env_bind_active()</code>). Use <code><a href="zap.html">zap()</a></code> to remove bindings.</p> </td></tr> </table> <h3>Value</h3> <p>A copy of <code>.env</code> enclosing the new environment containing bindings to <code>...</code> arguments. </p> <h3>See Also</h3> <p><code><a href="env_bind.html">env_bind()</a></code>, <code><a href="env_unbind.html">env_unbind()</a></code> </p> <h3>Examples</h3> <pre> orig_env <- env(a = 10) fn <- set_env(function() a, orig_env) # fn() currently sees `a` as the value `10`: fn() # env_bury() will bury the current scope of fn() behind a new # environment: fn <- env_bury(fn, a = 1000) fn() # Even though the symbol `a` is still defined deeper in the scope: orig_env$a </pre> <hr /><div style="text-align: center;">[Package <em>rlang</em> version 1.0.6 <a href="00Index.html">Index</a>]</div> </body></html>