R/patch_env.R

Defines functions patch_global_child_env

# build an environment that is a child of the global environment
# as data.table eval needs that for some things such as := and extensions
# and copy in items from environment
patch_global_child_env <- function(env) {
  force(env)
  nms <- ls(envir = env, all.names = TRUE)
  tmpenv <- new.env(parent = globalenv())
  for(ni in nms) {
    if (as.character(ni)[[1]]!="...") {
      assign(ni, get(ni, envir = env), envir = tmpenv)
    }
  }
  tmpenv
}
WinVector/rqdatatable documentation built on Aug. 22, 2023, 3:25 p.m.