R/attachFormals.R

Defines functions .attachFormals

.attachFormals <- function(fun, envir = NULL) {
  
  if (is.null(envir)) envir <- parent.frame()
  f <- formals(deparse(substitute(fun)))
  f <- lapply(f, function(x) if(!is(x,"name")) eval(x) else x)
  mapply(assign, names(f), f, MoreArgs = list(envir = envir))
  NULL
  
}
USEPA/CompTox-ToxCast-tcpl documentation built on April 22, 2024, 12:37 p.m.