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.


News

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.

install.packages("modules")

0.5.0 by Sebastian Warnholz, 7 months ago


http://wahani.github.io/modules


Report a bug at https://github.com/wahani/modules/issues


Browse source code at https://github.com/cran/modules


Authors: Sebastian Warnholz [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports stringr, utils

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


Imported by saeRobust, templates.


See at CRAN