cites_metadata: CITES shipment metadata

View source: R/connect.R

cites_metadataR Documentation

CITES shipment metadata

Description

The CITES database also includes tables of column-level metadata and meanings of codes in columns, as well as a listing of CITES Parties/country abbreviations. Convenience functions access these tables. As they are small, the functions collect the tables into R session memory, rather than returning a remote table.

This information is drawn from "A guide to using the CITES Trade Database", from the CITES website. More information on the shipment-level data can be found in the guidance help file.

Usage

cites_metadata()

cites_codes()

cites_parties()

Value

A tibble of metadata

Examples

if (cites_status()) {
  library(dplyr)

  # See the field definitions for cites_shipments()
  cites_metadata()

  # See the codes used for shipment purpose
  cites_codes() %>%
   filter(field == "Purpose")

  # See the most recent countries to join CITES
  cites_parties() %>%
    arrange(desc(date)) %>%
    head(10)

  # See countries or locations with non-standaard or outdated ISO codes
  cites_parties() %>%
    filter(former_code | non_ISO_code)

  # For remote connections to these tables, access the database directly:
  dplyr::tbl(cites_db(), "cites_metadata")
  dplyr::tbl(cites_db(), "cites_codes")
  dplyr::tbl(cites_db(), "cites_parties")
}

ropensci/citesdb documentation built on May 13, 2023, 1:53 a.m.