Self Contained Units of Source Code

Provides modules as an organizational unit for source code. Modules enforce to be more rigorous when defining dependencies and have a local search path. They can be used as a sub unit within packages or in scripts.


Version 0.8.0

  • CRAN release
  • Update to documentation
  • Bugfix: find 'module' inside a module declaration
  • New function 'getSearchPathContent' to investigate the search path of a module
  • getSearchPath can now handle functions and modules as argment
  • New vignettes
  • 'use' and 'import' now signal conflicts using 'packageStartupMessage' instead of 'message'. They can now also be uppressed using 'suppressPackageStartupMessage'.
  • Skipping test for cross package dependencies on CRAN - not yet possible to reproduce locally.

Version 0.7.0

  • CRAN release
  • New function 'depend' to declare package dependencies
  • Throw error when names are exported which are not available
  • New function 'amodule' aka module2 -> improved scoping of modules and dependency injection
  • The function 'use' will now find symbols defined in a top level environment
  • The function 'use' can now also handle URLs

Version 0.6.0

  • CRAN release
  • Fixing conditional use of packages in suggests

Version 0.5.2

  • Update documentation for parameterized modules.

Version 0.5.1

  • New function: extend, can be used to extend an existing module definition.

Version 0.5.0

  • CRAN release

Version 0.4.4

  • Eliminated package dependencies: 'aoos' and 'methods'

Version 0.4.3

  • Fix for print method.
  • Removing class and function 'modfun'

Version 0.4.2

  • The function 'import' now has the additional argument 'attach' and returns an environment containing the specified imports.

Version 0.4.1

  • Bugfix in expose when not called from within a module.

Version 0.4.0

  • Cran release
  • Minor bugfixes
  • Update for testthat compatibility

Version 0.3.1

  • 'export' now appends the vector of exports instead of replacing it.
  • Bugfix in 'export' for regexs.

Version 0.3.0

  • CRAN release

Version 0.2.4

  • 'import' now checks if a package dependency is installed instead of quietly waiting for a runtime error: fail early!

Version 0.2.3

  • modules can now distinguish between situations in which they are constructed inside a package, inside another module (nested module), or inside a script. This behaviour is implemented in 'autoTopEncl' and can be overridden. This behaviour defines the search path of a module.

Version 0.2.2

  • 'use' and 'expose' have different argument names. '...' can now be used to select objects to load / attach. The order of arguments has changed to be consistent with 'import'. 'reInit' can be used to trigger re-initialization of module.

Version 0.2.1

  • When 'use' is called, modules are re initialized by default.
  • A 'module' now has an attribute 'moduleConst' which knows how to initialize a module and contains sufficient information for that process.
  • New function 'expose' to inherit a whole module.

Version 0.2.0

  • CRAN release

Version 0.1.4

  • ad-hoc documentation of functions using '##' as trigger.

Version 0.1.3

  • as.module and thus use now accept a directory path. In this case all R-files in that directory are treated as module and returned as list of modules.

Version 0.1.2

  • use and import now avoid duplicate dependencies on the search path
  • new functions: getSearchPath, getSearchPathNames to explore the local search path

Version 0.1.1

  • fix when de-parsing imports

Version 0.1.0

  • CRAN release

Version 0.0.8

  • use does not attach by default
  • a regex in export is indicated by a leading "^"

Version 0.0.5

  • exports

Version 0.0.4

  • new function: as.module

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.10.0 by Sebastian Warnholz, 10 months ago

Report a bug at

Browse source code at

Authors: Sebastian Warnholz [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports utils

Suggests testthat, devtools, knitr, lintr, rmarkdown, parallel

Imported by LOGAN, REPLesentR, saeRobust.

See at CRAN