maintaining metadata
The function will handle metadata information on the dataset level as described in the section ‘Metadata’ of the Traitdata Standard (e.g. author
or bibliographicCitation
) and add a column datasetID
as well as datasetName
and author
if those are provided in the parameter metadata
of the as.traitdata()
function call which creates the data. The function as.metadata()
provides a standard structure for this case.
metadata1 <- as.metadata(
datasetName = "Carabid traits",
datasetID = "carabids",
bibliographicCitation = bibentry(
bibtype = "Article",
title = "Sensitivity of functional diversity metrics to sampling intensity",
journal = "Methods in Ecology and Evolution",
author = c(as.person("Fons van der Plas, Roel van Klink, Pete Manning, Han Olff, Markus Fischer")
),
year = 2017,
doi = "10.1111/2041-210x.12728"
),
author = "Fons van der Plas",
license = "http://creativecommons.org/publicdomain/zero/1.0/"
)
dataset1 <- as.traitdata(carabids,
taxa = "name_correct",
thesaurus = thesaurus1,
units = "mm",
keep = c(datasetID = "source_measurement", measurementRemark = "note"),
metadata = metadata1
)
#> Input is taken to be a species -- trait matrix. If this is not the case, please provide parameters!
head(dataset1)
#> scientificName traitName traitValue traitUnit measurementID
#> 1 Abax_parallelepipedus antenna_length 8.518519 mm 1
#> 2 Acupalpus_meridianus antenna_length 0.700000 mm 2
#> 3 Agonum_ericeti antenna_length 3.743386 mm 3
#> 4 Agonum_fuliginosum antenna_length 3.500000 mm 4
#> 5 Agonum_gracile antenna_length 3.220000 mm 5
#> 6 Agonum_marginatum antenna_length 5.030000 mm 6
#> datasetID measurementRemark
#> 1 klink <NA>
#> 2 WOODCOCK <NA>
#> 3 klink <NA>
#> 4 ribera <NA>
#> 5 ribera deduced_from_genus
#> 6 ribera <NA>
#>
#> This trait-dataset contains 4 traits for 120 taxa ( 480 measurements in total).
#>
#> carabids : Carabid traits by Fons van der Plas .
#>
#> When using these data, you must acknowledge the following usage policies:
#>
#> Cite this trait dataset as:
#> van der Plas F, van Klink R, Manning P, Olff H, Fischer M (2017).
#> "Sensitivity of functional diversity metrics to sampling intensity."
#> _Methods in Ecology and Evolution_. doi: 10.1111/2041-210x.12728 (URL:
#> https://doi.org/10.1111/2041-210x.12728).
#>
#> Published under: http://creativecommons.org/publicdomain/zero/1.0/
Note the use of the bibentry()
function to create a formal bibliographic entry. Also note that this also affects the way how the dataset is printed into the R console. This facilitates for data users to acknowledge authorship and ownership of the data, while also providing a machine readable structure that can easily be accessed further down the line.
metadata2 <- as.metadata(
datasetName = "Heteroptera morphometry traits",
datasetID = "heteroptera",
bibliographicCitation = bibentry(
bibtype = "Article",
title = "Morphometric measures of Heteroptera sampled in grasslands across three regions of Germany",
journal = "Ecology",
volume = 96,
issue = 4,
pages = 1154,
author = c(as.person("Martin M. Gossner , Nadja K. Simons, Leonhard Hoeck, Wolfgang W. Weisser")),
year = 2015,
doi = "10.1890/14-2159.1"
),
author = "Martin M. Gossner",
license = "http://creativecommons.org/publicdomain/zero/1.0/"
)
dataset2 <- as.traitdata(heteroptera_raw,
taxa = "SpeciesID",
thesaurus = thesaurus2,
units = "mm",
keep = c(sex = "Sex", references = "Source", lifestage = "Wing_development"),
metadata = metadata2
)
#> 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'.
database <- rbind(dataset1, dataset2,
datasetID = c("vanderplas17", "gossner15"),
metadata_as_columns = TRUE
)
#> Warning in rbind(deparse.level, ...): There seems to be no overlap in trait names of the provided datasets.
#> It is recommended to map 'traitNameStd' of each dataset to the same thesaurus or ontology!
#> Warning in rbind(deparse.level, ...): 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!
head(database)
#> scientificName traitName traitValue traitUnit measurementID
#> 1 Abax_parallelepipedus antenna_length 8.518519 mm 1
#> 2 Acupalpus_meridianus antenna_length 0.700000 mm 2
#> 3 Agonum_ericeti antenna_length 3.743386 mm 3
#> 4 Agonum_fuliginosum antenna_length 3.500000 mm 4
#> 5 Agonum_gracile antenna_length 3.220000 mm 5
#> 6 Agonum_marginatum antenna_length 5.030000 mm 6
#> occurrenceID references sex
#> 1 <NA> <NA> <NA>
#> 2 <NA> <NA> <NA>
#> 3 <NA> <NA> <NA>
#> 4 <NA> <NA> <NA>
#> 5 <NA> <NA> <NA>
#> 6 <NA> <NA> <NA>
#> license datasetID datasetName
#> 1 http://creativecommons.org/publicdomain/zero/1.0/ carabids Carabid traits
#> 2 http://creativecommons.org/publicdomain/zero/1.0/ carabids Carabid traits
#> 3 http://creativecommons.org/publicdomain/zero/1.0/ carabids Carabid traits
#> 4 http://creativecommons.org/publicdomain/zero/1.0/ carabids Carabid traits
#> 5 http://creativecommons.org/publicdomain/zero/1.0/ carabids Carabid traits
#> 6 http://creativecommons.org/publicdomain/zero/1.0/ carabids Carabid traits
#> author measurementRemark lifestage
#> 1 Fons van der Plas <NA> <NA>
#> 2 Fons van der Plas <NA> <NA>
#> 3 Fons van der Plas <NA> <NA>
#> 4 Fons van der Plas <NA> <NA>
#> 5 Fons van der Plas deduced_from_genus <NA>
#> 6 Fons van der Plas <NA> <NA>
#>
#> This trait-dataset contains 27 traits for 299 taxa ( 9386 measurements in total).
#> $carabids
#>
#> carabids : Carabid traits by Fons van der Plas .
#>
#> When using these data, you must acknowledge the following usage policies:
#>
#> Cite this trait dataset as:
#> van der Plas F, van Klink R, Manning P, Olff H, Fischer M (2017).
#> "Sensitivity of functional diversity metrics to sampling intensity."
#> _Methods in Ecology and Evolution_. doi: 10.1111/2041-210x.12728 (URL:
#> https://doi.org/10.1111/2041-210x.12728).
#>
#> Published under: http://creativecommons.org/publicdomain/zero/1.0/
#>
#>
#> $heteroptera
#>
#> heteroptera : Heteroptera morphometry traits by Martin M. Gossner .
#>
#> When using these data, you must acknowledge the following usage policies:
#>
#> Cite this trait dataset as:
#> Gossner MM, Simons NK, Hoeck L, Weisser WW (2015). "Morphometric
#> measures of Heteroptera sampled in grasslands across three regions of
#> Germany." _Ecology_, *96*, 1154. doi: 10.1890/14-2159.1 (URL:
#> https://doi.org/10.1890/14-2159.1).
#>
#> Published under: http://creativecommons.org/publicdomain/zero/1.0/
The detailed metadata information of both datasets (e.g. license and bibliographic citation) will be stored in the attributes of the dataset and displayed when calling it in R console. You can access the metadata via the attributes()
function. E.g.
attributes(dataset1)$metadata$bibliographicCitation
#> van der Plas F, van Klink R, Manning P, Olff H, Fischer M (2017).
#> "Sensitivity of functional diversity metrics to sampling intensity."
#> _Methods in Ecology and Evolution_. doi: 10.1111/2041-210x.12728 (URL:
#> https://doi.org/10.1111/2041-210x.12728).