rlang (version 0.0.0.9000)

env_clone: Clone an environment.

Description

This creates a new environment containing exactly the same objects, optionally with a new parent.

Usage

env_clone(x, parent = env_parent(x))

Arguments

x
An environment to clone.
parent
The parent of the cloned environment.

Examples

Run this code
env <- new_env(data = mtcars)
clone <- env_clone(env)
identical(env$cyl, clone$cyl)

Run the code above in your browser using DataLab