Skip to content

Repository files navigation

traitdata: R package for easy access to various ecological trait data

Installation

You can install traitdata from Github with:

# Install devtools if not availableif(!"remotes"%in% installed.packages()[,"Package"]) install.packages("remotes")
# Install traitdata package from Githubremotes::install_github("RS-eco/traitdata", build_vignettes=T, force=T)

After installation, simply load the traitdata package:

library(traitdata)

If you encounter a bug or if you have any problems, please file an issue on Github.

Data overview

There are 32 different data sets, which are included in this package:

datasetNamebasisOfRecordrightsHolderDOI
amniotatraitDatabaseMyrhvold et al. 201610.1890/15-0846R.1
amphi_lifehisttraitDatabaseTrochet et al. 201410.3897/BDJ.2.e4123
amphibiotraitDatabaseOliveira et al. 201710.1038/sdata.2017.123
an_agetraitDatabaseTacutu et al. 201810.1093/nar/gkx1042
anuran_morphotraitDatabaseMendoza-Henao et al. 201910.1002/ecy.2685
arthropodstraitDatabaseGossner et al. 201510.1038/sdata.2015.13
atlantic_birdstraitDatabaseRodrigues et al. 201910.1002/ecy.2647
australian_birdstraitDatabaseGarnett et al. 201510.1038/sdata.2015.61
AvianBodySizetraitDatabaseLislevand et al. 200710.1890/06-2054
bird_behavtraitDatabaseTobias & Pigot 201910.1098/rstb.2019.0012
carabidstraitDatabasevan der Plas et al. 201710.5061/dryad.53ds2
climbertraitDatabaseSchweiger et al. 201410.3897/zookeys.367.6185
dispersetraitDatabaseSarremejane et al. 202010.1038/s41597-020-00732-7
elton_birdstraitDatabaseWilman et al. 201410.1890/13-1917.1
elton_mammalstraitDatabaseWilman et al. 201410.1890/13-1917.1
epiphytestraitDatabaseHietz et al. 202110.1111/1365-2745.13802
eubirdstraitDatabaseStorchová & Hořák 201710.1111/geb.12709
fishmorphtraitDatabaseBrosse et al. 202110.1111/geb.13395
globalHWItraitDatabaseSheard et al. 202010.1038/s41467-020-16313-6
globThermtraitDatabaseBennett et al. 201810.1038/sdata.2018.22
heteropteratraitDatabaseGossner et al. 201610.6084/m9.figshare.c.3307611.v1
heteropteraRawtraitDatabaseGossner et al. 201610.6084/m9.figshare.c.3307611.v1
lizard_traitstraitDatabaseMeiri 201810.1111/geb.12773
mammal_diettraitDatabaseKissling et al. 201410.1002/ece3.1136
mammal_diet2traitDatabaseGainsbury et al. 201810.1111/mam.12119
marsupialstraitDatabaseFisher et al. 200110.1890/0012-9658(2001)082[3531:TEBOLH]2.0.CO;2
migbehav_birdsliteratureDataEyres & Fritz10.12761/SGN.2017.10058
pantheriatraitDatabaseJones et al. 200910.1890/08-1494.1
passerinestraitDatabaseRicklefs 201710.1002/ecy.1783
primatestraitDatabaseGalán-Acedo et al. 202010.1038/s41597-019-0059-9
reptile_lifehisttraitDatabaseGrimm et al. 201410.3897/natureconservation.9.8908
tetra_densitytraitDatabaseSantini et al. 201810.1111/geb.12756

Note: The code for how these datatsets were downloaded and processed can be found in the data-raw folder.

See also https://opentraits.org/datasets.html for an extensive list of Trait datasets.

An overview of the different datasets can also be found here: vignette("data_info").

Variables

  • All published datasets contain their original variables and species names. Species names were split into 2 columns (Genus and Species) and where applicable into a 3rd column with Subspecies names.
  • All datasets also have a scientificNameStd column, which is a standardised scientific name, in order to be able to merge the different datasets by species.

Note: Not all species names could be standardised, therefore some data entries might not contain a scientificNameStd value, please then refer to the Genus and Species column. In case you are interested in which species could not be standardised have a look at the names_nonStd file. Please also check out the synonyms data file, for species where an alternative name has been used for standardising the scientific name.

An overview of all variables with a description of each variable can be found in the trait_glossary data file:

data(trait_glossary)

or in the glossary vignette:

vignette("trait_glossary")

Data query

To connect to one or more datasets, we simply use the data() function.

# Load Elton Traits
data("elton_birds")

Now we can use standard R calls to have a look at the data.

First, we look at the column names of our dataset.

# Look at the variable names
colnames(elton_birds)
## [1] "SpecID" "PassNonPass" "Order" ## [4] "Family" "BLFamilyEnglish" "BLFamSequID" ## [7] "Taxo" "Genus" "Species" ## [10] "English" "Diet.Inv" "Diet.Vend" ## [13] "Diet.Vect" "Diet.Vfish" "Diet.Vunk" ## [16] "Diet.Scav" "Diet.Fruit" "Diet.Nect" ## [19] "Diet.Seed" "Diet.PlantO" "Diet.5Cat" ## [22] "Diet.Source" "Diet.Certainty" "Diet.EnteredBy" ## [25] "ForStrat.watbelowsurf" "ForStrat.wataroundsurf" "ForStrat.ground" ## [28] "ForStrat.understory" "ForStrat.midhigh" "ForStrat.canopy" ## [31] "ForStrat.aerial" "PelagicSpecialist" "ForStrat.Source" ## [34] "ForStrat.SpecLevel" "ForStrat.EnteredBy" "Nocturnal" ## [37] "BodyMass.Value" "BodyMass.Source" "BodyMass.SpecLevel" ## [40] "BodyMass.Comment" "Record.Comment" "Full.Reference" ## [43] "scientificNameStd"

Then, we check the class and first 6 rows of the first 10 columns of the elton_traits dataset:

class(elton_birds)
## [1] "data.frame"
head(elton_birds[,1:10])
## SpecID PassNonPass Order Family BLFamilyEnglish
## 1 28 Nonpasseriformes Struthioniformes Struthionidae Ostriches
## 2 37 Nonpasseriformes Rheiformes Rheidae Rheas
## 3 38 Nonpasseriformes Rheiformes Rheidae Rheas
## 4 45 Nonpasseriformes Casuariiformes Casuariidae Cassowaries
## 5 46 Nonpasseriformes Casuariiformes Casuariidae Cassowaries
## 6 47 Nonpasseriformes Casuariiformes Casuariidae Cassowaries
## BLFamSequID Taxo Genus Species English
## 1 2 BL3 Struthio camelus Ostrich
## 2 3 BL3 Rhea americana Greater Rhea
## 3 3 BL3 Rhea pennata Lesser Rhea
## 4 4 BL3 Casuarius casuarius Southern Cassowary
## 5 4 BL3 Casuarius bennetti Dwarf Cassowary
## 6 4 BL3 Casuarius unappendiculatus Northern Cassowary

For more information on how to use the data within the package, check out the access-data and all the other vignettes.

vignette("access-data")

Additional examples of how to use the different trait datasets can be found in the following vignettes:

vignette("island-birds")
vignette("migbehav_birds")
vignette("morpho-indices")
vignette("pantheria")
vignette("passerines")

About

R package for easy access to various ecological trait data

Resources

Stars

29 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages