Formatting and Harmonizing Ecological Trait-Data

Assistance for handling ecological trait data and applying the Ecological Trait-Data Standard terminology (Schneider et al. 2018 ). There are two major use cases: (1) preparation of own trait datasets for upload into public data bases, and (2) harmonizing trait datasets from different sources by re-formatting them into a unified format. See 'traitdataform' website for full documentation.


lifecycle Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status DOI

Assistance for handling functional trait data and transferring them into the Ecological Trait-Data Standard (Schneider et al. 2018 Towards an Ecological Trait-data Standard, biorxiv.org DOI: 10.1101/328302).

There are two major use cases for the package:

  • preparation of own trait datasets for upload into public data bases, and
  • harmonizing trait datasets from different sources by moulding them into a unified format.

The toolset of the package includes

  • transforming species-trait-matrix or occurence table data into a unified long-table format
  • mapping column names into terms provided in a standard trait vocabulary
  • matching of species names into GBIF Backbone Taxonomy (taxonomic ontology server)
  • matching of trait names into a user-provided traitlist, i.e. a thesaurus of traits
  • unifying trait values into target unit format and legit factor levels
  • saving trait dataset into a desired format using templates (e.g. for BExIS)

Installation

The package can be installed from Github via the 'devtools' package

install.packages('devtools')
devtools::install_github('EcologicalTraitData/traitdataform')

System requirements

The package requires the udunits library for unit conversion to be installed. It should install automatically, but if the package installation throws an error, it might need manual installation (see this thread for help).

Usage

 
pulldata("carabids")
 
thesaurus <- as.thesaurus(
       body_length = as.trait("body_length", 
         expectedUnit = "mm", 
         identifier = "length"
         ), 
       antenna_length = as.trait("antenna_length", 
         expectedUnit = "mm", 
         identifier = "antenna"
         ),
       metafemur_length = as.trait("metafemur_length", 
         expectedUnit = "mm", 
         identifier = "metafemur"
         ),
       eyewidth = as.trait("eyewidth_corr", 
         expectedUnit = "mm", 
         identifier = "eyewidth"
         )
)
                          
traitdataset1 <- standardize(carabids,
            thesaurus = thesaurus,
            taxa = "name_correct",
            units = "mm"
            )
 

Documentation

A documentation is available online at http://ecologicaltraitdata.github.io/traitdataform/ or offline in the package vignette 'traitdataform'.

Datasets

The traitdataform package links to a couple of datasets, which are used for demo purposes in the vignette and documentation, but can be used for research and production use.

The datasets have been published by their authors under Creative Commons 0 or Creative Commons Attribution license, which means they can be copied, modified, distributed without asking permission. Attribution must be given according to the dataset license.

For additional information and interpretation of the data please refer to the help pages of the data objects (e.g. calling ?carabids in R) and the original data sources given therein.

If you want further datasources published under Creative Commons Licenses or in the public domain being added to this package, feel free to file a pull-request with a script for download and harmonization in the data/ directory and a documentation appended to R/data.R!

Contributing

The package invites any contributions e.g. minor fixes and spell-checks, improving interoperability with data and other packages or software for trait-data handling. Please see the Contributing Guidelines for details.

Please note that the 'traitdataform' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Future features

The package is under open source development. You are invited to submit pull-requests with your improvements.

We are aiming to provide the following features in future iterations of the package:

  • extracting trait definitions and hierarchies from semantic ontologies (e.g. from the OWL files or via APIs), to facilitate analysis of comparable traits across taxa.
  • automated matching of user-provided trait names against trait definitions in online resources, by looking up traits from published ontologies.
  • harmonization of levels of factorial traits via fuzzy matching (requires lookup tables and ontologies providing legit factor levels).
  • managing trait databases locally in R by managing relational data (e.g. on occurence level or measurement level, sampling event, taxon etc.) in the data.frame attributes.

Cite as

Schneider, F.D. (2018) traitdataform - harmonizing ecological trait data in R, v0.5.0, http://ecologicaltraitdata.github.io/traitdataform

License

Copyright (c) 2018 F.D. Schneider, [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

News

traitdataform 0.5.4

  • enforce UTF-8 environment in Latin-1 locale now works for

traitdataform 0.5.3 (released on CRAN 2019-04-16)

  • character issues in strict Latin-1 locale have been resolved (apostrophe and en-dash)
  • a dependency on an external resource (ETS.csv) is now static.

traitdataform 0.5.2 (released on CRAN 30.12.2018)

  • solve minor compliance issues with CRAN: use LICENSE template

traitdataform 0.5.1

  • thorough spell-checking
  • set heavy examples to 'dontrun'

traitdataform 0.5.0 (released 04.12.2018)

DOI

stable, for submission on CRAN. From this point on, backwards compatibility will be maintained.

minor changes (since v0.4):

  • complete package vignette
  • improved unit handling
  • solid demo data import

traitdataform 0.4.4

  • finalize vignette (include section on writing data)

traitdataform 0.4.3

  • update rbind.traitdataform() to specify metadata handling

traitdataform 0.4.2

  • finalize package vignette
  • simplify demo data calls
  • fix handling of measurementID as factor
  • fix return of output in standardize()

traitdataform 0.4.1

  • update package vignette
  • fix print methods
  • fix thesaurus function
  • set helper functions internal (not exported)
  • fix file import for carabids

traitdataform 0.4.0 (released 26.11.2018)

bugfixes

  • fix locale issues with pulldata() on linux (still not solved on Mac OS X)
  • eliminate dependency on 'reshape' package

Minor changes

  • the functions cast.traitdata() and mutate.traitdata() now support units.

traitdataform 0.3.4

  • update as.trait() and as.thesaurus() as well as print methods
  • update dependencies on units()

traitdataform 0.3.3

  • rename and update standardize_taxa() <- standardize.taxonomy()
  • rename standardize_traits() <- standardize.traits()
  • fix environment issues with pulldata()

traitdataform 0.3.1

  • clean rewrite of get_gbif_taxonomy()
  • test_that implementation
  • Travis CI implementation
  • add Code of Conduct and CONTRIBUTING

traitdataform 0.3.0

DOI

  • solve all errors, warnings and notes on R CHECK
  • complete man pages
  • fix matching bug for get_gbif_taxonomy()

traitdataform 0.2.6

  • fix function mutate.traitdata() (remove method dependency to dplyr)
  • update documentation for as.trait()
  • successful build of vignette

traitdataform 0.2.5

  • fix export of get_gbif_taxonomy()
  • handle subspecies and superspecies cases
  • handle warnings in taxon mapping output
  • update documentation on taxon mapping

traitdataform 0.2.4

  • fix export of standardize.exploratories() to include all columns by default.
  • start fixing install warnings

traitdataform 0.2.3

  • fixing broken NAMESPACE export
  • update documentation website

traitdataform 0.2.2

  • fix bug in standardize.taxonomy(): reset row.names.
  • update data attributes in dataset carabids for handling in as.traitdata().

traitdataform 0.2.1

  • add function as.metadata() for templating of metadata into an object class, including method print.metadata()
  • update as.traitdata, print.traitdata, rbind.traitdata to make use of as.metadata
  • provide metadata and thesaurus as attributes in data object 'carabids'
  • update as.traitdata(): enable forwarding of attributes of input object (for metadata etc. )

traitdataform 0.2

Major changes

  • updated terms to traitdata standard v0.6.
  • datasets are not loaded by default, but wait for a prompt using data(). Also added documentation for all datasets and added more datasets.
  • adding function method rbind.traitdata() for merging standardised datasets into a unified table. includes handling of metadata object in attributes
  • metadata can be stored in the attributes of a dataset and will be preserved when updating the dataset. Information will be handled when merging or combining multiple datasets.
  • trait thesauri can be added more easily from a data frame or from a list of 'trait' objects.

Minor changes

  • update vignette: add section on merging and combining data.
  • added print methods for traits and thesaurus objects.

traitdataform 0.1.7

Major changes

  • add function standardize.exploratories() to extract georeference data for a plotID.
  • add function read.service() (provided by Dennis Heimann & Andreas Ostrowski) for access of datasets on BExIS. I added a secure masked prompt using the 'getPass' package.

Bug fixes

  • Spelling of 'occurrence'

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("traitdataform")

0.5.5 by Florian D. Schneider, 2 months ago


https://EcologicalTraitData.github.io/traitdataform, https://github.com/EcologicalTraitData/traitdataform


Report a bug at https://github.com/EcologicalTraitData/traitdataform/issues


Browse source code at https://github.com/cran/traitdataform


Authors: Florian D. Schneider [aut, cre] , Caterina Penone [ctb] , Andreas Ostrowski [ctb] , Dennis Heimann [ctb] , Felix Neff [ctb] , Markus J. Ankenbrand [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports data.table, reshape2, taxize, getPass, units, XML, RCurl, plyr

Suggests knitr, rmarkdown, testthat


See at CRAN