Method for function rbind() to append objects of class 'traitdata' to each other.

# S3 method for traitdata
rbind(..., metadata = NULL, datasetID = NULL,
  drop = NULL)

Arguments

...

two or more objects of class traitdata.

metadata

a list of metadata entries which are to be added as dataset-level information.

datasetID

a vector of the same length as number of objects. If NULL (default), object names will be returned as ID.

drop

FALSE by default. If true, columns that are not present in all datasets will be dropped.

Details

Metadata are ideally already included in the datasets as attributes (see ?as.traitdata). The function rbind.traitdata() takes a list of lists as its metadata argument. The outer list must have the same length as the provided objects to combine, with each entry containing objects according to the terms of the Ecological Traitdata Standard (http://ecologicaltraitdata.github.io/ETS/#metadata-vocabulary).

A lookup table for dataset details will be appended as an attribute to the output dataset, linked to each entry via the field datasetID. It can be accessed by calling attributes(<dataset>)$datasets.

Examples

data(carabids)
#> loading dataset 'carabids' from original data source! #> When using this data, please cite the original publication: #> van der Plas F, van Klink R, Manning P, Olff H and Fischer M (2017). #> Sensitivity of functional diversity metrics to sampling intensity. #> _Methods in Ecology and Evolution_. doi: 10.1111/2041-210x.12728 (URL: #> http://doi.org/10.1111/2041-210x.12728).
dataset1 <- as.traitdata(carabids, taxa = "name_correct", traits = c("body_length", "antenna_length", "metafemur_length"), units = "mm", keep = c(datasetID = "source_measurement", measurementRemarks = "note"), metadata = list( bibliographicCitation = attributes(carabids)$citeAs, author = "Fons van der Plas", license = "http://creativecommons.org/publicdomain/zero/1.0/" ) )
#> Input is taken to be a species -- trait matrix. If this is not the case, please provide parameters!
traits1 <- as.thesaurus( body_length = as.trait("body_length", expectedUnit = "mm", valueType = "numeric", identifier = "http://t-sita.cesab.org/BETSI_vizInfo.jsp?trait=Body_length"), antenna_length = as.trait("antenna_length", expectedUnit = "mm", valueType = "numeric", identifier = "http://t-sita.cesab.org/BETSI_vizInfo.jsp?trait=Antenna_length"), metafemur_length = as.trait("metafemur_length", expectedUnit = "mm", valueType = "numeric", identifier = "http://t-sita.cesab.org/BETSI_vizInfo.jsp?trait=Femur_length") ) dataset1Std <- standardize.traits(dataset1, thesaurus = traits1)
#> Warning: trait value has not been harmonized to standard terms! To perform standardization provide field 'valueType', as well as 'traitUnitStd' and 'factorLevels' for numeric and factorial traits, respectively!
#> Warning: trait value has not been harmonized to standard terms! To perform standardization provide field 'valueType', as well as 'traitUnitStd' and 'factorLevels' for numeric and factorial traits, respectively!
#> Warning: trait value has not been harmonized to standard terms! To perform standardization provide field 'valueType', as well as 'traitUnitStd' and 'factorLevels' for numeric and factorial traits, respectively!
# occurrence table: data(heteroptera_raw)
#> loading dataset 'heteropteraRaw' from original data source! #> When using this data, please cite the original publication: #> Gossner MM, Simons NK, Hck L and Weisser WW (2015). Morphometric #> measures of Heteroptera sampled in grasslands across three regions of #> Germany. _Ecology_, *96*, pp. 1154. doi: 10.1890/14-2159.1 (URL: #> http://doi.org/10.1890/14-2159.1).
dataset2 <- as.traitdata(heteroptera_raw, taxa = "SpeciesID", traits = c("Body_length", "Antenna_Seg1", "Antenna_Seg2", "Antenna_Seg3", "Antenna_Seg4", "Antenna_Seg5", "Hind.Femur_length"), units = "mm", keep = c(sex = "Sex", references = "Source", lifeStage = "Wing_development"), metadata = list( bibliographicCitation = attributes(heteroptera_raw)$citeAs, author = "Martin Gossner", license = "http://creativecommons.org/publicdomain/zero/1.0/" ) )
#> it seems you are providing repeated measures of traits on multiple specimens of the same species (i.e. an occurrence table)! Sequential identifiers for the occuences will be added. If your dataset contains user-defined occurrenceIDs you may specify the column name in parameter 'occurrences'.
dataset2 <- mutate.traitdata(dataset2, antenna_length = Antenna_Seg1 + Antenna_Seg2 + Antenna_Seg3 + Antenna_Seg4 + Antenna_Seg3 ) traits2 <- as.thesaurus( body_length = as.trait("body_length", expectedUnit = "mm", valueType = "numeric", identifier = "http://t-sita.cesab.org/BETSI_vizInfo.jsp?trait=Body_length"), antenna_length = as.trait("antenna_length", expectedUnit = "mm", valueType = "numeric", identifier = "http://t-sita.cesab.org/BETSI_vizInfo.jsp?trait=Antenna_length"), metafemur_length = as.trait("metafemur_length", expectedUnit = "mm", valueType = "numeric", identifier = "http://t-sita.cesab.org/BETSI_vizInfo.jsp?trait=Femur_length") ) dataset2Std <- standardize.traits(dataset2, thesaurus = traits2, rename = c(Body_length = "body_length", antenna_length = "antenna_length", Hind.Femur_length = "metafemur_length" ) )
#> Warning: trait value has not been harmonized to standard terms! To perform standardization provide field 'valueType', as well as 'traitUnitStd' and 'factorLevels' for numeric and factorial traits, respectively!
#> Warning: trait value has not been harmonized to standard terms! To perform standardization provide field 'valueType', as well as 'traitUnitStd' and 'factorLevels' for numeric and factorial traits, respectively!
#> Warning: trait value has not been harmonized to standard terms! To perform standardization provide field 'valueType', as well as 'traitUnitStd' and 'factorLevels' for numeric and factorial traits, respectively!
database <- rbind(dataset1Std, dataset2Std)
#> Warning: There seems to be no overlap in taxon names of the provided datasets. #> It is recommended to map 'ScientificNameStd' of each dataset to the same thesaurus or ontology!