Skip to content
Iñaki Ucar edited this page Jan 22, 2025 · 3 revisions

Background

The R package units implements support for measurement units in R vectors, matrices and arrays, enabling automatic propagation, conversion, derivation and simplification of units, and promoting correctness by raising errors in case of unit incompatibility. It uses the UNIDATA udunits library and unit database for unit compatibility checking and conversion. See the R Journal paper for further details.

[TODO: @billdenney: How units comes short for certain applications and the need for the substances package] See this discussion for further details.

Related work

The substances package will be part of the r-quantities project, which currently consists of:

  • units: Provides measurement units for R vectors.
  • errors: Provides uncertainty propagation for R vectors.
  • quantities: Integrates the 'units' and 'errors' packages for a complete quantity calculus system.
  • constants: Provides the CODATA reference on the fundamental physical constants, units and uncertainty.

There are other software packages dealing to some extent with quantity calculus (see Flater (2016) for further discussion), but, to the best of our knowledge, there are no substance-aware implementations.

Details of your coding project

This project is about the development of a new R package called substances that will enable substance-aware unit conversions, which requires the complete development cycle:

  • Definition and implementation of the substances object.
  • Definition of the architecture and behavior of such object.
  • Implementation of all the necessary methods for different families of generics (arithmetic operators, mathematical functions...).
  • Documentation (manual, examples, vignettes, webpage).
  • Testing (test suite, CI on GitHub Actions).

Expected impact

[TODO: @billdenney: Fields of application]

Mentors

Tests

Contributors, please do one or more of the following tests before contacting the mentors above.

MENTORS: write several tests that potential contributors can do to demonstrate their capabilities for this particular project. Ask some hard questions that will give you insight about how the contributors write code to solve problems. You'll see that the harder the questions that you ask, the easier it will be for you to choose between the contributors that apply for your project! Please modify the suggestions below to make them specific for your project.

  • Easy: something that any useR should be able to do, e.g. download some existing package listed in the Related Work, and run it on some example data.
  • Medium: something a bit more complicated. You can encourage contributors to write a script or some functions that show their R coding abilities.
  • Hard: Can the contributor write a package with Rd files, tests, and vignettes? If your package interfaces with non-R code, can the contributor write in that other language?

Solutions of tests

Contributors, please post a link to your test results here.

  • EXAMPLE CONTRIBUTOR 1 NAME, LINK TO GITHUB PROFILE, LINK TO TEST RESULTS.
Clone this wiki locally