Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

env_clone

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)

rlang

Functions for Base Types and Core R and 'Tidyverse' Features

v0.4.11
MIT + file LICENSE
Authors
Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.