| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/database.R |
| 3 |
\name{load_units_xml} |
| 4 |
\alias{load_units_xml} |
| 5 |
\title{Load a unit system} |
| 6 |
\usage{ |
| 7 |
load_units_xml(path = default_units_xml()) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{path}{a path to a valid unit system in XML format.} |
| 11 |
} |
| 12 |
\description{ |
| 13 |
Load an XML database containing a unit system compatible with UDUNITS2. |
| 14 |
} |
| 15 |
\details{ |
| 16 |
A unit system comprises a root \code{<unit-system>} and a number of children |
| 17 |
defining prefixes (\code{<prefix>}) or units (\code{<unit>}). |
| 18 |
See the contents of |
| 19 |
|
| 20 |
\code{system.file("share/udunits", package="units")} |
| 21 |
|
| 22 |
for examples. |
| 23 |
} |
| 24 |
\examples{ |
| 25 |
# load a new unit system |
| 26 |
load_units_xml(system.file("share/udunits/udunits2-base.xml", package="units")) |
| 27 |
\dontrun{ |
| 28 |
set_units(1, rad) # doesn'twork |
| 29 |
} |
| 30 |
|
| 31 |
# reload the default unit system |
| 32 |
load_units_xml() |
| 33 |
set_units(1, rad) # works again |
| 34 |
|
| 35 |
} |