Design Principles for lightr

This vignette outlines the design decisions that have been taken during the development of the {lightr} R package, and provides some of the reasoning, and possible pros and cons of each decision.

This document is primarily intended to be read by those interested in understanding the code within the package and for potential package contributors.

Scope

This package focuses on files produced by UV/VIS spectrophotometers.

Architecture

This package has two-level of functions:

knitr::include_graphics("architecture.svg")
The high-level functions (lr_get_spec(), lr_get_metadata() and lr_convert_tocsv()) feed individual files to the internal dispatch function (dispatch_parser()), which then passes each file to the relevant low-level parser.

Package architecture diagram

Naming conventions