copy_vars: Copy variables from one environment to another environment

Description Usage Arguments Value Author(s) See Also Examples

Description

Copy variables from one environment to another environment

Usage

1
copy_vars(from.env, to.env = .GlobalEnv, vars = ls(envir = from.env))

Arguments

from.env

environment where variables are to be copied from

to.env

environment where variables are to be copied to

vars

character vector of named variables to copy from from.env

Value

invisible

Author(s)

Thomas P. Harte

See Also

put.var

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
e<- new.env()
local({
  a<- "a"
  b<- "this is 'b'"
  x<- pi
}, env=e)

f<- new.env()
copy_vars(from=e, to=f)
whos(sort="Name", env=f)

g<- new.env()
copy_vars(from=e, to=g, vars=(c("b","x")))
whos(sort="Name", env=g)

tharte/tutils documentation built on Feb. 11, 2020, 9:17 a.m.