R: Clone an environment

env_clone {rlang} | R Documentation

## Clone an environment

### Description

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

### Usage

    env_clone(env, parent = env_parent(env))

### Arguments

`env` | An environment.
`parent` | The parent of the cloned environment.

### Examples

    env <- env(!!! mtcars)
    clone <- env_clone(env)
    identical(env, clone)
    identical(env$cyl, clone$cyl)

[Package rlang version 0.4.5 Index]