Description Usage Arguments Examples
Copy all items from the environment to a new environment. By default, the new environment will share the same parent environment.
1 | duplicate_env(envir, parent = parent.env(envir))
|
envir |
environment to duplicate |
parent |
parent environment to set for the new environment. Defaults to the parent environment of |
1 2 3 4 5 6 7 8 9 | # Make a new environment with the object 'key'
envir <- new.env()
envir$key <- "value"
"key" %in% ls() # FALSE
"key" %in% ls(envir = envir) # TRUE
# Duplicate the envir and show it contains 'key'
new_envir <- duplicate_env(envir)
"key" %in% ls(envir = new_envir) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.