R Package Introduction

dmdScheme Version v0.9.8

Rainer M Krug Rainer@uzh.ch

2019-05-24

The R Package

The Definition of the dmdScheme is done in an R package, which gives all the tools to enter the meatada and to export it into xml.

Installation

The package is not yet on CRAN. Therefore it needs to be installed from github. This will install the last verion on github.

For a list of releases see here

Entering new Metadata

To enter new data to the dmdScheme, you have to

This should open Excel and the file should look similar to this:

  1. The file is saved in a temporary directory. It needs to be saved at a different location, if you want to keep the changes.
  2. Data can only be entered in the green cells with. All other cells are write protected.

After entering the data, save it to a location for further processing.

Importing Data from Excel Sheet

Next, you have to import the data entered in the Excel sheet int R:

For convenience, we use the exapmle data included in the package by using

#> New names:
#> * `` -> ...1
#> * `` -> ...2
#> * `` -> ...3
#> * `` -> ...4
#> * `` -> ...5
#> * … and 9 more problems
#> propertySet : valueProperty
#> Transposing...
#> New names:
#> * `` -> ...1
#> * `` -> ...2
#> * `` -> ...3
#> * `` -> ...4
#> * `` -> ...5
#> * … and 9 more problems
#> Set names...
#> Set attributes...
#> Apply types...
#>    Apply type 'character' to 'name'...
#>    Apply type 'character' to 'temperature'...
#>    Apply type 'character' to 'light'...
#>    Apply type 'character' to 'humidity'...
#>    Apply type 'character' to 'incubator'...
#>    Apply type 'character' to 'container'...
#>    Apply type 'numeric' to 'microcosmVolume'...
#>    Apply type 'character' to 'mediaType'...
#>    Apply type 'numeric' to 'mediaConcentration'...
#>    Apply type 'character' to 'cultureConditions'...
#>    Apply type 'character' to 'comunityType'...
#>    Apply type 'character' to 'mediaAdditions'...
#>    Apply type 'integer' to 'duration'...
#>    Apply type 'character' to 'comment'...
#> Set class...
#> Done
#> propertySet : Genus
#> Set names...
#> Set attributes...
#> Apply types...
#>    Apply type 'character' to 'speciesID'...
#>    Apply type 'character' to 'colour'...
#>    Apply type 'character' to 'density'...
#>    Apply type 'character' to 'functionalGroup'...
#>    Apply type 'character' to 'comment'...
#> Set class...
#> Done
#> propertySet : Treatments
#> Set names...
#> Set attributes...
#> Apply types...
#>    Apply type 'character' to 'treatmentID'...
#>    Apply type 'character' to 'treatmentLevelHeight'...
#>    Apply type 'character' to 'comment'...
#> Set class...
#> Done
#> propertySet : Measurement
#> Set names...
#> Set attributes...
#> Apply types...
#>    Apply type 'character' to 'measurementID'...
#>    Apply type 'character' to 'variable'...
#>    Apply type 'character' to 'method'...
#>    Apply type 'character' to 'unit'...
#>    Apply type 'character' to 'object'...
#>    Apply type 'integer' to 'noOfSamplesInTimeSeries'...
#>    Apply type 'numeric' to 'samplingVolume'...
#>    Apply type 'character' to 'dataExtractionID'...
#>    Apply type 'character' to 'measuredFrom'...
#>    Apply type 'character' to 'comment'...
#> Set class...
#> Done
#> propertySet : DataExtraction
#> Set names...
#> Set attributes...
#> Apply types...
#>    Apply type 'character' to 'dataExtractionID'...
#>    Apply type 'character' to 'method'...
#>    Apply type 'character' to 'parameter'...
#>    Apply type 'character' to 'value'...
#>    Apply type 'character' to 'comment'...
#> Set class...
#> Done
#> propertySet : DataFileMetaData
#> Set names...
#> Set attributes...
#> Apply types...
#>    Apply type 'character' to 'dataFileName'...
#>    Apply type 'character' to 'columnName'...
#>    Apply type 'character' to 'columnData'...
#>    Apply type 'character' to 'mappingColumn'...
#>    Apply type 'character' to 'type'...
#>    Apply type 'character' to 'description'...
#>    Apply type 'character' to 'comment'...
#> Set class...
#> Done

Converting Metadata to xml

You can export the data to an an xml file:

When you specify the argument file, the xml will be saved:

Validation

dmdSchemeSet_raw against dmdScheme

When running read_from_excel(), the dafault is to validate the raw data before conversion to an dmdScheme object to guarantee a valid dmdScheme is returned. If the validation fails, an error is raised.

xml against xsd

Not incorporated yet but planned.

General things

The dmdScheme data in R can be also saved, loaded, and edited using the standard R commands.