R: get_unitList

get_unitList {EML} | R Documentation

## get_unitList

### Description

get_unitList

### Usage

    get_unitList(x = read_eml(system.file("xsd/eml-2.1.1/eml-unitDictionary.xml",
      package = "EML")))

### Arguments

`x` | a unitList object. Usually found in eml@additionalMetadata[[1]]@metadata, see details

### Details

If no unitList is provided, the function reads in the eml-unitDictionary defining all standard units and unitTypes. This provides a convenient way to look up standard units and their EML-recognized names when defining metadata, e.g. in the table passed to 'set_attributes()'.

### Value

a list with two data.frames: "units", a table defining unit names, types, and conversions to SI, and "unitTypes", defining the type of unit. For instance, the unit table could define "Hertz" as a unit of unitType frequency, and the unitType define frequency as a type whose dimension is 1/time.

### Examples

    # Read in additional units defined in a EML file

    f <- system.file("xsd/test/eml-datasetWithUnits.xml", package = "EML")
    eml <- read_eml(f)
    unitList <- get_unitList(eml@additionalMetadata[[1]]@metadata)

    ## Read in the definitions of standard units:
    get_unitList()

[Package EML version 1.0.3 Index]