tests/reattachModule.R

library(modules)

# We check that a module gets properly re attached, when we load a new version.
# this works inside of a module; but as reported not in .Globalenv: #24

m <- modules::module({
  fun <- function(x) x
})

use(m, attach = TRUE)

stopifnot(fun(1) == 1)

m <- modules::module({
  fun <- function(x) x + 1
})

use(m, attach = TRUE)

stopifnot(fun(1) == 2)

Try the modules package in your browser

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

modules documentation built on Aug. 25, 2023, 5:17 p.m.