Skip to content

Instantly share code, notes, and snippets.

@abubelinha
Forked from cboettig/col_versions.R
Created February 12, 2022 20:02
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