wideTable.to.eMoF: convert dataframe to a DarwinCore extended Measurement or...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/DataFormat_Utils.R

Description

converts a dataframe to a DarwinCore extended Measurement Or Fact (eMOF) file

Usage

1
wideTable.to.eMoF(metadata.object, variables)

Arguments

metadata.object

a MIxS.metadata object

variables

a character vector. a list of the variables that need to be included in the eMoF

Details

extended Measurement or Fact (eMoF) as a DarwinCore extension to standardize environmental or other additional data in a computer readable fashion. This standard structures data into a long format (a column with sample name, variable name and value). This function converts more commonly used wide format tables (that is, structured like a matrix, e.g. samples as rows and variables as columns) into the correct long format that complies to eMoF

Value

a data.frame formatted as an extended Measurement or Fact table

Author(s)

Maxime Sweetlove

See Also

Other formating functions: combine.data.frame(), combine.data(), eMoF.to.wideTable(), wideTab.to.hierarchicalTab()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sampleNames <- c("sample_1", "sample_2")
test_MIxS <- new("MIxS.metadata",
             data = data.frame(var1=c(1,2), var2=c(3,4), 
                               eventID=sampleNames, 
                               row.names=sampleNames),
             section = c(var1="section1", var2="section1", 
                         eventID="miscellaneous"),
             units = c(var1="unit1", var2="unit2", 
                       eventID="alphanumeric"),
             env_package = "water",
             type = "versatile",
             QC = TRUE)
wideTable.to.eMoF(metadata.object=test_MIxS, variables=c("var1", "var2"))

biodiversity-aq/OmicsMetaData documentation built on Dec. 19, 2021, 9:44 a.m.