unit.scale: Unit scale from SI prefix

View source: R/units.R

unit.scaleR Documentation

Unit scale from SI prefix

Description

This function reads a prefix from a string and returns the exponent (base-10) that this prefix represents.

Usage

unit.scale(prefix)

Arguments

prefix

a string, e.g.: "M", "mega", "m", "milli", "µ", "micro", etc.

Value

an integer that corresponds to the prefix, defaults to 0.

Examples

> unit.scale("M")
[1] 6
> unit.scale("µ")
[1] -6

a-kramer/SBtabVFGEN documentation built on Nov. 14, 2024, 8:41 p.m.