Turns wide-table formats (species-traits matrix and occurrence table) into long-table format. As input, the function requires information about which columns contain traits, given as a list of trait-names, and which column contains the taxon name. For tables containing repeated measurements of traits within the same taxon, an occurrenceID should be given or will be created.

as.traitdata(x, traits = attributes(x)$traits, taxa = attributes(x)$taxa,
individuals = attributes(x)$individuals, occurrences = individuals, datasetID = attributes(x)$datasetID,
measurements = attributes(x)$measurements, units = attributes(x)$units,
keep = attributes(x)$keep, drop = NULL, na.rm = TRUE, id.vars = names(x)[names(x) %in% keep & !names(x) %in% drop], mutate = NULL, thesaurus = attributes(x)$thesaurus,