0 - Details and Setup

Published

May 1, 2025

Create folders for output

library(fs)
dir_create("Data/Raw")
dir_create("Data/Intermediate")
dir_create("Data/Datasets")
dir_create("Data/Final")
dir_create("Data/Spatial")
dir_create("Results")
dir_create("Results/Figures")

Get packages

If possible, use renv to restore the packages

renv::restore()

Otherwise install by hand e.g., install.packages(c("tidyverse", "sf")

Establish date ranges

We want May 1st to July 31st in Julian days

lubridate::yday(c("2023-05-01",
                  "2020-05-01", # Leap year
                  "2023-07-31",
                  "2020-07-31")) # Leap year
[1] 121 122 212 213

We’ll use 121 - 213

Acquire raw data files

  • E-bird data must be requested here
    • I made a special request for Long-billed Curlews from 2010-05 to 2022-08
    • Once the request is approved you’ll get an email and can download the data (I’ve found this can take between 2 hours and 5 days)
  • You’ll also need to download the complete checklist data (currently not available as a special request)
  • Extract all the files (including the internal compressed files)
    • You’ll have to move the 2 main data files into Data/Raw after they’ve been extracted
    • The sampling file: ebd_sampling_relMay-2023.txt
    • The observations file: ebd_lobcur_201005_202208_relMay-2023.txt
  • Tell auk where that folder is (below) and restart R
    • Only need to do this step once
auk::auk_set_ebd_path(path = "Data/Raw/", overwrite = TRUE)
EBD_PATH set to /home/steffi/Projects/Business/Matt/lb_curlew_distribution/Data/Raw