quantities | R Documentation |
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.
qty(x = double(), unit, scale_to_best_metric = TRUE)
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 |
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
qty()
: generate a quantity object
Other quantity functions:
check_quantities
,
make_qty_units_explicit()
,
metric_scaling
,
quantity_data
,
quantity_units
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.