R/assign_global.R

assign_global <- function(x) {
  # Assign a variable to the global environment,
  # not simply the parent environment (as with <<-),
  # with the same name
  assign(
    x = deparse(substitute(x)),
    value = x,
    envir = .GlobalEnv
  )
}
rvanmazijk/rvmr documentation built on May 9, 2019, 7:37 a.m.