R client for various sources of species trait data.

What is a trait? A “trait” for the purposes of this package is broadly defined as an aspect of a species that can be described or measured, such as physical traits (size, length, height, color), behavioral traits (running speed, etc.), and even variables that make up the niche of the species (e.g., habitat).

Included in traits with the associated function prefix or function name:

Souce Function prefix Link
BETYdb betydb_ http://www.betydb.org
NCBI ncbi_ http://www.ncbi.nlm.nih.gov/
Encylopedia of Life traitbank_ https://github.com/EOL/eol_website/blob/master/doc/api.md
Coral Traits Database coral_ https://coraltraits.org/
Birdlife International birdlife_ https://www.birdlife.org/
LEDA Traitbase leda_
USDA Plants Database tr_usda
Zanne et al. plant dataset tr_zanne
Amniote life history dataset tr_ernest

Talk to us on the issues page if you know of a source of traits data with an API, and we’ll see about including it.

Installation

Stable CRAN version

Or development version from GitHub

devtools::install_github("ropensci/traits")
library("traits")
library("dplyr")

BETYdb

Get trait data for Willow (Salix spp.)

Summarise data from the output data.frame

EOL’s traitbank trait data

traitbank(query = "MATCH (n:Trait) RETURN n LIMIT 1;")
#> $columns
#> [1] "n"
#> 
#> $data
#> $data[[1]]
#>   metadata.id metadata.labels
#> 1    20280619           Trait
#>                                                                                     paged_traverse
#> 1 http://10.252.248.44:7474/db/data/node/20280619/paged/traverse/{returnType}{?pageSize,leaseTime}
#>                                              outgoing_relationships
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships/out
#>                                                        outgoing_typed_relationships
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships/out/{-list|&|types}
#>                                                   labels
#> 1 http://10.252.248.44:7474/db/data/node/20280619/labels
#>                                             create_relationship
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships
#>                                                                traverse
#> 1 http://10.252.248.44:7474/db/data/node/20280619/traverse/{returnType}
#>                                                   all_relationships
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships/all
#>                                                             all_typed_relationships
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships/all/{-list|&|types}
#>                                                           property
#> 1 http://10.252.248.44:7474/db/data/node/20280619/properties/{key}
#>                                              self
#> 1 http://10.252.248.44:7474/db/data/node/20280619
#>                                             incoming_relationships
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships/in
#>                                                   properties
#> 1 http://10.252.248.44:7474/db/data/node/20280619/properties
#>                                                       incoming_typed_relationships
#> 1 http://10.252.248.44:7474/db/data/node/20280619/relationships/in/{-list|&|types}
#>     data.eol_pk data.resource_pk
#> 1 R74-PK5014587           110690
#>                                data.scientific_name
#> 1 <i>Adenopodia floribunda</i> (Kleinhoonte) Brenan
#>                                data.source
#> 1 http://www.pnas.org/content/114/40/10695
#>                                                                   data.literal
#> 1 http://eol.org/schema/terms/Tropical_and_subtropical_moist_broadleaf_forests

Meta

ropensci_footer