Learn R Programming

Quantity Calculus for R

The quantities package provides integration of the 'units' and 'errors' packages for a complete quantity calculus system for R vectors, matrices and arrays, with automatic propagation, conversion, derivation and simplification of magnitudes and uncertainties.

Documentation

Blog posts:

  1. Quantities for R -- First working prototype, Mar 1, 2018.
  2. Using quantities to parse data with units and errors, May 7, 2018.
  3. Data wrangling operations with quantities, Jun 27, 2018.
  4. Quantities for R -- Ready for a CRAN release, Aug 31, 2018.

Vignettes:

Papers:

  • Edzer Pebesma, Thomas Mailund and James Hiebert (2016). "Measurement Units in R." The R Journal, 8 (2), 486--494. DOI: 10.32614/RJ-2016-061
  • Iñaki Ucar, Edzer Pebesma and Arturo Azcorra (2018). "Measurement Errors in R." The R Journal, 10 (2), 549--557. DOI: 10.32614/RJ-2018-075

Installation

Install the release version from CRAN:

install.packages("quantities")

The installation from GitHub requires the remotes package.

# install.packages("remotes")
remotes::install_github(paste("r-quantities", c("units", "errors", "quantities"), sep="/"))

Acknowledgement

This project gratefully acknowledges financial support from the

Copy Link

Version

Install

install.packages('quantities')

Monthly Downloads

199

Version

0.2.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

I<c3><b1>aki Ucar

Last Published

January 18th, 2025

Functions in quantities (0.2.3)

t.quantities

Matrix Transpose
rep.quantities

Replicate Elements of Vectors and Lists
drop_quantities

Drop Units and Errors
errors

Handle Measurement Uncertainty on a Numeric Vector
as.matrix.quantities

Coerce to a Matrix
as.list.quantities

Coerce to a List
correl

Handle Correlations Between quantities Objects
cbind.quantities

Combine R Objects by Rows or Columns
c.quantities

Combine Values into a Vector or List
Extract.quantities

Extract or Replace Parts of an Object
diff.quantities

Lagged Differences
as.data.frame.quantities

Coerce to a Data Frame
groupGeneric.quantities

S3 Group Generic Functions
quantities

Handle Measurement Units and Uncertainty on a Numeric Vector
quantities-package

quantities: Quantity Calculus for R Vectors
parse_quantities

Parse Units and Errors
units

Handle Measurement Units on a Numeric Vector