cites_shipments | R Documentation |
Returns a remote database table with all CITES shipment data. This is the
bulk of the data in the package and constitutes > 20 million records. Loading
the whole table into R via the dplyr::collect()
command will use over
3 GB of RAM, so you may want to pre-process data in the database, as in
the examples below.
cites_shipments()
A dplyr remote tibble (dplyr::tbl()
)
if (cites_status()) {
library(dplyr)
# See the number of CITES shipment records per year
cites_shipments() %>%
group_by(Year) %>%
summarize(n_records = n()) %>%
arrange(desc(Year)) %>%
collect()
# See what pangolin shipments went to which countries in 1990
cites_shipments() %>%
filter(Order == "Pholidota", Year == 1990) %>%
count(Year, Importer, Term) %>%
collect() %>%
left_join(select(cites_parties(), country, code),
by = c("Importer" = "code"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.