R/testModule.R

Defines functions TestModule2 TestModule1

# File with test modules to test scoping inside a package.

TestModule1 <- function(a) module({
  foo <- identity
  b <- a
})

TestModule2 <- function() module(topEncl = baseenv(), {
  c <- 3
  expose(TestModule1(c))
  tm1 <- use(TestModule1)(c)
})

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.