Description Usage Arguments Value Author(s) See Also Examples
Bind an object to an environment
. If the object is a
function
then the environment of the
function
is also set to the environment
.
1 | bind_to_env(object, envir)
|
object |
of any type |
envir |
|
invisible
Thomas P. Harte
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | e<- new.env()
x<- 1:3
`fun`<- function() {
x
}
bind_to_env(x, env=e)
bind_to_env(fun, env=e)
x<- 1:10
all.equal(
fun(), 1:10
)
whos(sort="Name", env=e, omit=NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.