This function is not presently used by any oce functions, and is provided as a convenience function for users.

as.unit(u, default = list(unit = expression(), scale = ""))

Arguments

u

A character string indicating a variable name. The following names are recognized: "DBAR", "IPTS-68", "ITS-90", "PSS-78", and "UMOL/KG". All other names yield a return value equal to the value of the default argument.

default

A default to be used for the return value, if u is not a recognized string.

Value

A list with elements unit, an expression(), and scale, a string.

Examples

as.unit("DBAR")
#> $unit #> expression(dbar) #> #> $scale #> [1] "" #>
as.unit("IPTS-68")
#> $unit #> expression(degree * C) #> #> $scale #> [1] "IPTS-68" #>
as.unit("ITS-90")
#> $unit #> expression(degree * C) #> #> $scale #> [1] "ITS-90" #>
as.unit("PSS-78")
#> $unit #> expression() #> #> $scale #> [1] "PSS-78" #>
as.unit("UMOL/KG")
#> $unit #> expression(mu * mol/kg) #> #> $scale #> [1] "" #>