e1 <- new.env()
e2 <- new.env()
assign("a1", 1:1e3, envir = e1)
assign("a2", 1:1e3, envir = e1)
objs <- c("a1", "a2")
# move objects between environments
changeObjEnv(objs, fromEnv = e1, toEnv = e2)
Run the code above in your browser using DataLab