citesdb
citesdb: An R package to support analysis of CITES Trade Database shipment-level data - Published in JOSS (2019)
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 8 DOI reference(s) in README -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
:warning: ARCHIVED :warning: A high-performance database of shipment-level CITES trade data
Basic Info
Statistics
- Stars: 11
- Watchers: 6
- Forks: 5
- Open Issues: 0
- Releases: 3
Topics
Metadata Files
README-not.md
citesdb
Authors: Noam Ross, Evan A. Eskew and Mauricio Vargas
citesdb is an R package to conveniently analyze the full CITES shipment-level wildlife trade database, available at https://trade.cites.org/. This data consists of over 40 years and 20 million records of reported shipments of wildlife and wildlife products subject to oversight under the Convention on International Trade in Endangered Species of Wild Fauna and Flora. The source data are maintained by the UN Environment World Conservation Monitoring Centre.
Installation
Install the citesdb package with this command:
r
devtools::install_github("ropensci/citesdb")
Note that since citesdb installs a source dependency from GitHub, you will need package build tools.
Usage
Getting the data
When you first load the package, you will see a message like this:
library(citesdb)
#> Local CITES database empty or corrupt. Download with cites_db_download()
Not to worry, just do as it says and run cites_db_download(). This
will fetch the most recent database from online, an approximately 158 MB
download. It will expand to over 1 GB in the local database. During the
download and database building, up to 3.5 GB of disk space may be used
temporarily.
Using the database
Once you fetch the data, you can connect to the database with the
cites_db() command. The cites_shipments() command loads a remote
tibble that is backed by the database but is not loaded into R. You
can use this command to analyze CITES data without ever loading it into
memory, gathering your results with the dplyr function collect().
For example:
``` r library(citesdb) library(dplyr)
start <- Sys.time()
citesshipments() %>% groupby(Year) %>% summarize(n_records = n()) %>% arrange(desc(Year)) %>% collect()
> # A tibble: 45 x 2
> Year n_records
>
> 1 2019 12610
> 2 2018 1143044
> 3 2017 1246684
> 4 2016 1293178
> 5 2015 1299183
> 6 2014 1109877
> 7 2013 1127377
> 8 2012 1096664
> 9 2011 950148
> 10 2010 894115
> # … with 35 more rows
stop <- Sys.time() ```
(Note that running collect() on all of cites_shipments() will load
a >3 GB data frame into memory!)
The back-end database, duckdb, is very fast and powerful, making analyses on such large data quite snappy using normal desktops and laptops. Here’s the timing of the above query, which processes over 20 million records:
``` r stop - start
> Time difference of 0.4658868 secs
```
If you are using a recent version of RStudio interactively, loading the CITES package also brings up a browsable pane in the “Connections” tab that lets you explore and preview the database, as well as interact with it directly via SQL commands.
If you don’t need any of the bells and whistles of this package, you can
download the raw data as a single compressed TSV file from the releases
page, or as a .zip file
of many CSV files from the original source at
https://trade.cites.org/.
Metadata
The package database also contains tables of field metadata, codes used,
and CITES countries. This information comes from “A guide to using the
CITES Trade
Database”,
on the CITES website. Convenience functions cites_metadata(),
cites_codes(), and cites_parties() access this information:
``` r head(cites_metadata())
> # A tibble: 6 x 2
> variable description
>
> 1 Year year in which trade occurred
> 2 Appendix CITES Appendix of taxon concerned
> 3 Taxon scientific name of animal or plant concerned
> 4 Class scientific name of animal or plant concerned
> 5 Order scientific name of animal or plant concerned
> 6 Family scientific name of animal or plant concerned
head(cites_codes())
> # A tibble: 6 x 3
> field code description
>
> 1 Purpose B Breeding in captivity or artificial propagation
> 2 Purpose E Educational
> 3 Purpose G Botanical garden
> 4 Purpose H Hunting trophy
> 5 Purpose L Law enforcement / judicial / forensic
> 6 Purpose M Medical (including biomedical research)
head(cites_parties())
> # A tibble: 6 x 6
> country code formercode nonISOcode date datasource
>
> 1 Afghanistan AF FALSE FALSE 1986-01-28 'A guide to using the CITES Trade Database', Version 8, Anne…
> 2 Africa XF FALSE TRUE 'A guide to using the CITES Trade Database', Version 8, Anne…
> 3 Åland Islands AX FALSE FALSE 'A guide to using the CITES Trade Database', Version 8, Anne…
> 4 Albania AL FALSE FALSE 2003-09-25 'A guide to using the CITES Trade Database', Version 8, Anne…
> 5 Algeria DZ FALSE FALSE 1984-02-21 'A guide to using the CITES Trade Database', Version 8, Anne…
> 6 American Samoa AS FALSE FALSE 'A guide to using the CITES Trade Database', Version 8, Anne…
```
More information on the release of shipment-level CITES data can be
found in the ?guidance help file.
Related work
The rcites package provides access to the Speciesplus/CITES Checklist API, which includes metadata about species and their protected status through time.
Citation
If you use citesdb in a publication, please cite both the package and source data:
Ross, Noam, Evan A. Eskew, and Nicolas Ray. 2019. citesdb: An R package to support analysis of CITES Trade Database shipment-level data. Journal of Open Source Software, 4(37), 1483, https://doi.org/10.21105/joss.01483
UNEP-WCMC (Comps.) 2019. Full CITES Trade Database Download. Version 2019.2. CITES Secretariat, Geneva, Switzerland. Compiled by UNEP-WCMC, Cambridge, UK. Available at: https://trade.cites.org.
Contributing
Have feedback or want to contribute? Great! Please take a look at the contributing guidelines before filing an issue or pull request.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Owner
- Name: rOpenSci Archive
- Login: ropensci-archive
- Kind: organization
- Email: info@ropensci.org
- Website: ropensci.org
- Repositories: 259
- Profile: https://github.com/ropensci-archive
Abandoned rOpenSci projects -- email info@ropensci.org if you have questions!
CodeMeta (codemeta.json)
{
"@context": [
"https://doi.org/10.5063/schema/codemeta-2.0",
"http://schema.org"
],
"@type": "SoftwareSourceCode",
"identifier": "citesdb",
"description": "Provides convenient access to over 40 years and 20 million records of\n endangered wildlife trade data from the Convention on International Trade\n in Endangered Species of Wild Fauna and Flora, stored on a local on-disk,\n out-of memory 'DuckDB' database for bulk analysis.",
"name": "citesdb: A High-Performance Database of Shipment-Level 'CITES' Trade Data",
"codeRepository": "https://github.com/ropensci/citesdb",
"relatedLink": [
"https://docs.ropensci.org/citesdb",
"https://www.cites.org/"
],
"issueTracker": "https://github.com/ropensci/citesdb/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "0.3.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 3.6.3 (2020-02-29)",
"author": [
{
"@type": "Person",
"givenName": "Noam",
"familyName": "Ross",
"email": "ross@ecohealthalliance.org",
"@id": "https://orcid.org/0000-0002-2136-0000"
},
{
"@type": "Person",
"givenName": "Evan A.",
"familyName": "Eskew",
"email": "eskew@ecohealthalliance.org",
"@id": "https://orcid.org/0000-0002-1153-5356"
},
{
"@type": "Person",
"givenName": "Mauricio",
"familyName": "Vargas"
}
],
"contributor": [
{
"@type": "Person",
"givenName": "Nicolas",
"familyName": "Ray"
},
{
"@type": "Organization",
"name": "UNEP World Conservation Monitoring Centre"
}
],
"copyrightHolder": [
{
"@type": "Organization",
"name": "EcoHealth Alliance"
}
],
"funder": [
{
"@type": "Organization",
"name": "USAID PREDICT"
},
{
"@type": "Organization",
"name": "EcoHealth Alliance"
}
],
"maintainer": [
{
"@type": "Person",
"givenName": "Noam",
"familyName": "Ross",
"email": "ross@ecohealthalliance.org",
"@id": "https://orcid.org/0000-0002-2136-0000"
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "spelling",
"name": "spelling",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=spelling"
},
{
"@type": "SoftwareApplication",
"identifier": "testthat",
"name": "testthat",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=testthat"
},
{
"@type": "SoftwareApplication",
"identifier": "roxygen2",
"name": "roxygen2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=roxygen2"
},
{
"@type": "SoftwareApplication",
"identifier": "knitr",
"name": "knitr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "rmarkdown",
"name": "rmarkdown",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rmarkdown"
},
{
"@type": "SoftwareApplication",
"identifier": "rstudioapi",
"name": "rstudioapi",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rstudioapi"
},
{
"@type": "SoftwareApplication",
"identifier": "lintr",
"name": "lintr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=lintr"
},
{
"@type": "SoftwareApplication",
"identifier": "callr",
"name": "callr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=callr"
},
{
"@type": "SoftwareApplication",
"identifier": "here",
"name": "here",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=here"
},
{
"@type": "SoftwareApplication",
"identifier": "ggplot2",
"name": "ggplot2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggplot2"
},
{
"@type": "SoftwareApplication",
"identifier": "rcites",
"name": "rcites",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rcites"
}
],
"softwareRequirements": [
{
"@type": "SoftwareApplication",
"identifier": "duckdb",
"name": "duckdb",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=duckdb"
},
{
"@type": "SoftwareApplication",
"identifier": "rappdirs",
"name": "rappdirs",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rappdirs"
},
{
"@type": "SoftwareApplication",
"identifier": "DBI",
"name": "DBI",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=DBI"
},
{
"@type": "SoftwareApplication",
"identifier": "httr",
"name": "httr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=httr"
},
{
"@type": "SoftwareApplication",
"identifier": "R.utils",
"name": "R.utils",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=R.utils"
},
{
"@type": "SoftwareApplication",
"identifier": "purrr",
"name": "purrr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=purrr"
},
{
"@type": "SoftwareApplication",
"identifier": "tools",
"name": "tools"
},
{
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
{
"@type": "SoftwareApplication",
"identifier": "dbplyr",
"name": "dbplyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dbplyr"
}
],
"releaseNotes": "https://github.com/ropensci/citesdb/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/citesdb/blob/master/README.md",
"fileSize": "3443.675KB",
"contIntegration": [
"https://circleci.com/gh/ropensci/citesdb",
"https://codecov.io/gh/ropensci/citesdb"
],
"developmentStatus": "https://www.repostatus.org/#active",
"review": {
"@type": "Review",
"url": "https://github.com/ropensci/software-review/issues/292",
"provider": "https://ropensci.org"
},
"keywords": [
"r",
"rstats",
"r-package",
"wildlife",
"dataset"
],
"citation": [
{
"@type": "ScholarlyArticle",
"datePublished": "2019",
"author": [
{
"@type": "Person",
"givenName": "Noam",
"familyName": "Ross"
},
{
"@type": "Person",
"givenName": [
"Evan",
"A."
],
"familyName": "Eskew"
},
{
"@type": "Person",
"givenName": "Nicolas",
"familyName": "Ray"
}
],
"name": "citesdb: An R package to support analysis of CITES Trade Database shipment-level data",
"identifier": "10.21105/joss.01483",
"url": "https://doi.org/10.21105/joss.01483",
"pagination": "1483",
"@id": "https://doi.org/10.21105/joss.01483",
"sameAs": "https://doi.org/10.21105/joss.01483",
"isPartOf": {
"@type": "PublicationIssue",
"issueNumber": "37",
"datePublished": "2019",
"isPartOf": {
"@type": [
"PublicationVolume",
"Periodical"
],
"volumeNumber": "4",
"name": "Journal of Open Source Software"
}
}
},
{
"@type": "CreativeWork",
"datePublished": "2019",
"author": [
{
"@type": "Organization",
"name": "UNEP-WCMC"
}
],
"name": "Full CITES Trade Database Download. Version 2019.2",
"url": "https://trade.cites.org"
}
]
}
GitHub Events
Total
Last Year
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Noam Ross | r****s@e****g | 107 |
| Noam Ross | n****s@g****m | 71 |
| Evan Eskew | e****w@g****m | 33 |
| Maëlle Salmon | m****n@y****e | 3 |
| Jeroen Ooms | j****s@g****m | 1 |
| Pachamaltese | m****s@d****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 12
- Total pull requests: 9
- Average time to close issues: 10 months
- Average time to close pull requests: 10 months
- Total issue authors: 7
- Total pull request authors: 5
- Average comments per issue: 4.25
- Average comments per pull request: 1.0
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- pachadotdev (4)
- noamross (3)
- cmzambranat (1)
- maelle (1)
- jeroen (1)
- mirandajasmine (1)
- dvdhrtr (1)
Pull Request Authors
- pachadotdev (3)
- noamross (3)
- maelle (1)
- emmamendelsohn (1)
- jeroen (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- DBI * imports
- R.utils * imports
- dbplyr * imports
- dplyr * imports
- duckdb * imports
- httr * imports
- purrr * imports
- rappdirs * imports
- tools * imports
- callr * suggests
- ggplot2 * suggests
- here * suggests
- knitr * suggests
- lintr * suggests
- rcites * suggests
- rmarkdown * suggests
- roxygen2 * suggests
- rstudioapi * suggests
- spelling * suggests
- testthat * suggests
