quantities: Quantities

quantitiesR Documentation

Quantities

Description

The qty function makes it easy to keep track of different quantities in chemical calculations. Metric prefixes are fully supported, i.e. any unit can be combined with standard metric_scaling scaling (mL, nmol, kg, etc.). Some quantities can also be used in common arithmetic operations.

Usage

qty(x = double(), unit, scale_to_best_metric = TRUE)

Arguments

x

the numeric value of the quantity, can be a single value or a vector

unit

the unit of the quantity

scale_to_best_metric

whether to automatically scale to the best metric prefix

Details

The following types of quantities are supported.

amount (N): base unit mol but also understands mole, all metric prefixes allowed

mass (m): base unit g, all metric prefixes allowed

molecular weight (MW): base unit g/mol, all metric prefixes allowed in the numerator

molarity concentration (C): base unit M but also understands mol/L, all metric prefixes allowed in the numerator

mass concentration (C): base unit g/L but also understands g/l, all metric prefixes allowed in the numerator. This is technically a density and sometimes referred to as such in the microbial kitchen documentation.

volume (V): base unit L but also understands l, all metric prefixes allowed

pressure (P): base unit bar but also understands Pa, all metric prefixes allowed, the common non-metric units atm, psi, Torr, mTorr, and % SP (% at standard pressure = % of 1 bar) are also supported and will be automatically converted to bar.

gas solubility (S): base unit M/bar, all metric prefixes allowed in the numerator, the common non-metric unit M/atm is also supported and will be automatically converted to M/bar. This quantity is used for capturing Henry's law constants.

temperature (T): base unit K but also understands C and F and converts them to Kelvin

Functions

  • qty(): generate a quantity object

See Also

Other quantity functions: check_quantities, make_qty_units_explicit(), metric_scaling, quantity_data, quantity_units

Examples

qty(0.045, "mmol/L")
qty(200, "mbar")
qty(6, "psi")
qty(30, "C")
qty(100, "K")
qty(5, "mg/L")
qty(1, "mM/bar")
qty(257, "g/mol")

KopfLab/microbialkitchen documentation built on July 31, 2023, 4:34 a.m.