The need for tools to make R code more modular, and to improve codereuse, is demonstrated by the wealth of related packages that havesprung up over the years. Many of them have objectives similar to ‘box’,although they vary wildly in how they approach their common goal, andnot all objectives are shared. In the following I’ve listed the relatedR packages that I know of. The descriptions are (mostly) copied from therespective package metadata, and the interested reader is invited toconsult the original documentation.
The list is intended to be a fairly exhaustive — so if you find amissing package please let me know.
‘modules’(no relation to the predecessor of ‘box’, also called ‘modules’):Provides modules as an organizational unit for source code. Modulesenforce to be more rigorous when defining dependencies and have a localsearch path. They can be used as a sub unit within packages or inscripts.
‘trinker/pysty’:‘Python’ style packages importing using the common forms of:import PACKAGE,import PACKAGE as ALIAS, orfrom PACKAGE import FUN1, FUN2, FUN_N.
‘Shiny’modules: ‘Shiny’ modules address the namespacing problem in Shiny UIand server logic, adding a level of abstraction beyondfunctions.
‘Novartis/tidymodules’:‘tidymodules’ offers a robust framework for developing ‘Shiny’ modulesbased on R6 classes which should facilitates inter-modulescommunication.
The packages listed above also provide means for loading code;however, I won’t replicate them here. Some of the tools below havesubsequently also gained capabilities for authoring modular code, butsince their initial and primary purpose wasloading code,they’re instead listed below.
‘import’:Alternative mechanism for importing objects from packages and R modules.The syntax allows for importing multiple objects with a single commandin an expressive way. The import package bridges some of the gap betweenusing library (or require) and direct (single-object) imports.Furthermore the imported objects are not placed in the currentenvironment.
‘conflicted’: R’sdefault conflict management system gives the most recently loadedpackage precedence. This can make it hard to detect conflicts,particularly when they arise because a package update creates ambiguitythat did not previously exist. ‘conflicted’ takes a different approach,making every conflict an error and forcing you to choose which functionto use.
‘pacman’: Tools tomore conveniently perform tasks associated with add-on packages. pacmanconveniently wraps library and package related functions and names themin an intuitive and consistent fashion. It seeks to combinefunctionality from lower level functions which can speed upworkflow.
‘jonocarroll/importAs’:Import namespaces as shorthand symbols rather than full package names,in a python-esque fashion.
‘needs’:A simple function for easier package loading andauto-installation.
‘importar’:Enables ‘Python’-like importing/loading of packages or functions withaliasing to prevent namespace conflicts.
xfun::pkg_attach():A vectorized version oflibrary()
‘RSuite’:Supports safe and reproducible solutions development in R. It will helpyou with environment separation per project, dependency management,local packages creation and preparing deployment packs for yoursolutions. (Archived as of 2025-11-25)
‘mvbutils’:Hierarchical workspace tree, code editing and backup, easy package prep,editing of packages while loaded, per-object lazy-loading, easydocumentation, macro functions, and miscellaneous utilities.