Converts numeric values between units using a symbolic unit system, SI-derived expansions, and graph-based conversion for non-SI units.
Details
Supports:
SI base units (m, kg, s, A, K, mol, cd)
Derived units (N, Pa, J, W, Hz)
Prefixes (k, m, µ, etc.)
Compound units (e.g.
"km/h","kg*m/s^2")Unit powers (e.g.
"m2","s^-1")Temperature conversion (C, F, K)
The function internally:
Parses units into symbolic components
Expands derived units (e.g.
N = kg*m/s^2)Computes dimensional vectors
Applies prefix scaling
Uses a graph search (Dijkstra) for non-SI conversions
The function checks dimensional consistency before conversion. If units are not compatible, an error is thrown.
For non-SI units (e.g. "mi", "bar"), conversion
paths are resolved via a graph representation of Units.
Temperature conversions are handled separately and do not use multiplicative scaling.
See also
Other format:
fm(),
fmCI(),
print.Unit(),
style(),
unit()
