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)
#> verbatimScientificName verbatimTraitName verbatimTraitValue verbatimTraitUnit
#> 1 Abax_parallelepipedus antenna_length 8.518519 mm
#> 2 Acupalpus_meridianus antenna_length 0.700000 mm
#> 3 Agonum_ericeti antenna_length 3.743386 mm
#> 4 Agonum_fuliginosum antenna_length 3.500000 mm
#> 5 Agonum_gracile antenna_length 3.220000 mm
#> 6 Agonum_marginatum antenna_length 5.030000 mm
#> measurementID datasetID measurementRemark
#> 1 1 klink <NA>
#> 2 2 WOODCOCK <NA>
#> 3 3 klink <NA>
#> 4 4 ribera <NA>
#> 5 5 ribera deduced_from_genus
#> 6 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
#> <https://doi.org/10.1111/2041-210x.12728>.
#>
#> Published under: http://creativecommons.org/publicdomain/zero/1.0/
#>
#> This dataset conforms to: [1] "Ecological Trait-data Standard (ETS) v0.10"
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
)
#> Input is taken to be an occurrence table/an observation -- trait matrix
#> (i.e. with individual specimens per row and multiple trait measurements in columns).
#> If this is not the case, please provide parameters!
database <- rbind(dataset1, dataset2,
datasetID = c("vanderplas17", "gossner15"),
metadata_as_columns = TRUE
)
head(database)
#> verbatimScientificName verbatimTraitName verbatimTraitValue verbatimTraitUnit
#> 1 Abax_parallelepipedus antenna_length 8.518519 mm
#> 2 Acupalpus_meridianus antenna_length 0.700000 mm
#> 3 Agonum_ericeti antenna_length 3.743386 mm
#> 4 Agonum_fuliginosum antenna_length 3.500000 mm
#> 5 Agonum_gracile antenna_length 3.220000 mm
#> 6 Agonum_marginatum antenna_length 5.030000 mm
#> measurementID occurrenceID references sex datasetID datasetName
#> 1 1 <NA> <NA> <NA> carabids Carabid traits
#> 2 2 <NA> <NA> <NA> carabids Carabid traits
#> 3 3 <NA> <NA> <NA> carabids Carabid traits
#> 4 4 <NA> <NA> <NA> carabids Carabid traits
#> 5 5 <NA> <NA> <NA> carabids Carabid traits
#> 6 6 <NA> <NA> <NA> carabids Carabid traits
#> author license
#> 1 Fons van der Plas http://creativecommons.org/publicdomain/zero/1.0/
#> 2 Fons van der Plas http://creativecommons.org/publicdomain/zero/1.0/
#> 3 Fons van der Plas http://creativecommons.org/publicdomain/zero/1.0/
#> 4 Fons van der Plas http://creativecommons.org/publicdomain/zero/1.0/
#> 5 Fons van der Plas http://creativecommons.org/publicdomain/zero/1.0/
#> 6 Fons van der Plas http://creativecommons.org/publicdomain/zero/1.0/
#> measurementRemark lifestage
#> 1 <NA> <NA>
#> 2 <NA> <NA>
#> 3 <NA> <NA>
#> 4 <NA> <NA>
#> 5 deduced_from_genus <NA>
#> 6 <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
#> <https://doi.org/10.1111/2041-210x.12728>.
#>
#> Published under: http://creativecommons.org/publicdomain/zero/1.0/
#>
#> This dataset conforms to: [1] "Ecological Trait-data Standard (ETS) v0.10"
#>
#>
#> $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
#> <https://doi.org/10.1890/14-2159.1>.
#>
#> Published under: http://creativecommons.org/publicdomain/zero/1.0/
#>
#> This dataset conforms to: [1] "Ecological Trait-data Standard (ETS) v0.10"
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
#> <https://doi.org/10.1111/2041-210x.12728>.