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
}

Try the rqdatatable package in your browser

Any scripts or data that you put into this service are public.

rqdatatable documentation built on Aug. 21, 2023, 9:10 a.m.