Skip to content

Instantly share code, notes, and snippets.

@cboettig
Created August 9, 2021 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cboettig/fc19fdb69069c44c2eaedf6089433518 to your computer and use it in GitHub Desktop.
Save cboettig/fc19fdb69069c44c2eaedf6089433518 to your computer and use it in GitHub Desktop.
library(tidyverse)
# 2017 monthly
x <- tempfile("col")
dir.create(x)
download.file("https://download.catalogueoflife.org/col/monthly/2017-02-27_dwca.zip", file.path(x, "dwca.zip"))
unzip(file.path(x, "dwca.zip"), exdir = x)
fs::dir_ls(x)
taxa <- readr::read_tsv(file.path(x, "taxa.txt"), guess_max=1e6, quote="", col_types = readr::cols(.default = "c"))
taxa %>% filter(specificEpithet == "sapiens", taxonomicStatus == "accepted name", genus=="Homo")
taxa %>% filter(taxonID == 3048432)
taxa %>% filter(taxonID == 27703827)
## 2013 annual
x <- tempfile("col")
dir.create(x)
download.file("https://download.catalogueoflife.org/col/annual/2013_dwca.zip", file.path(x, "dwca.zip"))
unzip(file.path(x, "dwca.zip"), exdir = x)
fs::dir_ls(x)
taxa <- readr::read_tsv(file.path(x, "taxa.txt"), guess_max=1e6, quote="", col_types = readr::cols(.default = "c"))
taxa %>% filter(specificEpithet == "sapiens", taxonomicStatus == "accepted name", genus=="Homo")
taxa %>% filter(taxonID == 3048432) # 2020
taxa %>% filter(taxonID == 27703827)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment