Create a trait thesaurus object for use as a reference object/lookup table of traits within function standardize.traits().

as.thesaurus(..., replace = NULL)



multiple objects of class 'trait' (produced by function as.trait()) or a data.frame containing columns according to the terms provided by


named character vector, with new names as values, and old names as names.


a list of formalized objects of class 'trait', as returned by function as.trait().


the object class 'trait' comprises necessary information to map a trait name to a trait definition, a target unit and a globally unique identifier. The thesaurus will be used in function 'standardize.traits()' to apply unit conversion and factor level harmonization.


# provide traitlist by defining individual traits using function `as.trait()`: traitlist <- as.thesaurus(body_length = as.trait("body_length", expectedUnit = "mm", valueType = "numeric", identifier = ""), antenna_length = as.trait("antenna_length", expectedUnit = "mm", valueType = "numeric", identifier = ""), metafemur_length = as.trait("metafemur_length", expectedUnit = "mm", valueType = "numeric", identifier = "") ) # provide traitlist from data frame object: as.thesaurus(data.frame( trait = c("body_length", "antenna_length", "metafemur_length", "eyewidth_corr"), expectedUnit = "mm", valueType = "numeric", traitDescription = c("body length in mm", "length of antenna in mm", "length of metafemur in mm", "eye width in mm"), identifier = c("", "", "", "" ) ) )
#> trait #> antenna_length antenna_length #> body_length body_length #> eyewidth_corr eyewidth_corr #> metafemur_length metafemur_length #> identifier #> antenna_length #> body_length #> eyewidth_corr #> metafemur_length #> broaderTerm narrowerTerm expectedUnit maxAllowedValue #> antenna_length NA NA mm NA #> body_length NA NA mm NA #> eyewidth_corr NA NA mm NA #> metafemur_length NA NA mm NA #> minAllowedValue factorLevels valueType #> antenna_length NA NA numeric #> body_length NA NA numeric #> eyewidth_corr NA NA numeric #> metafemur_length NA NA numeric #> traitDescription comments relationSource source #> antenna_length length of antenna in mm NA NA NA #> body_length body length in mm NA NA NA #> eyewidth_corr eye width in mm NA NA NA #> metafemur_length length of metafemur in mm NA NA NA #> version author #> antenna_length NA NA #> body_length NA NA #> eyewidth_corr NA NA #> metafemur_length NA NA
# provide traitlist from remote archive with renaming traits1 <- as.thesaurus(read.csv(""), replace = c(traitID = "identifier", traitName = "trait", traitUnit = "expectedUnit", Comments = "comments") )