### Download and Load Example Data Source: https://github.com/ebird/ebirdst/blob/main/docs/index.md Downloads example data for a species and loads the relative abundance raster stack. Ensure necessary libraries are installed and loaded. ```r library(fields) library(rnaturalearth) library(sf) library(terra) library(ebirdst) # download example data, yellow-bellied sapsucker in michigan ebirdst_download_status(species = "yebsap-example") # load relative abundance raster stack with 52 layers, one for each week abd <- load_raster("yebsap-example", resolution = "27km") ``` -------------------------------- ### Download and Load Example Data in R Source: https://github.com/ebird/ebirdst/blob/main/README.md Demonstrates how to download a simplified example dataset for Yellow-bellied Sapsucker in Michigan and load the relative abundance raster stack. Ensure the 'ebirdst' package is installed and loaded. ```r library(fields) library(rnaturalearth) library(sf) library(terra) library(ebirdst) # download example data, yellow-bellied sapsucker in michigan ebirdst_download_status(species = "yebsap-example") # load relative abundance raster stack with 52 layers, one for each week abd <- load_raster("yebsap-example", resolution = "27km") # load species specific mapping parameters pars <- load_fac_map_parameters("yebsap-example") # custom coordinate reference system crs <- st_crs(pars$custom_projection) # legend breaks breaks <- pars$weekly_bins # legend labels for top, middle, and bottom labels <- pars$weekly_labels ``` -------------------------------- ### Example: Get Default Species Path Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/get_species_path.md Demonstrates how to get the path for an example dataset. This is useful for testing or accessing sample data. ```r if (FALSE) { # \dontrun{ # get the path path <- get_species_path("yebsap-example") # get the path to the full data package for yellow-bellied sapsucker # common name, scientific name, or species code can be used path <- get_species_path("Yellow-bellied Sapsucker") path <- get_species_path("Sphyrapicus varius") path <- get_species_path("yebsap") } # } ``` -------------------------------- ### Example Usage of load_config Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_config.md Demonstrates downloading example data and then loading its configuration parameters. This example is non-runnable by default and requires prior download. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # load configuration parameters p <- load_config("yebsap-example") } # } ``` -------------------------------- ### Example Download URL Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/api.md An example of a complete download URL. This shows how to substitute the object path for a specific file and a placeholder access key. ```text https://st-download.ebird.org/v1/fetch?objKey=2023/woothr/seasonal/woothr_abundance_seasonal_mean_3km_2023.tif&key=XXXXXXXX ``` -------------------------------- ### Download and Load Regional Stats Example Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_regional_stats.html This example demonstrates how to download example data for regional statistics and then load it using the `load_regional_stats` function. It is intended for use when the example data has not yet been downloaded. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # load configuration parameters regional <- load_regional_stats("yebsap-example") } # } ``` -------------------------------- ### Download and Load Example Raster Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_raster.html Demonstrates downloading example data and loading weekly relative abundance rasters. Note that only 27km resolution data is available for the example. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # weekly relative abundance # note that only 27 km data are available for the example data abd_weekly <- load_raster("yebsap-example", "abundance", resolution = "27km") # the weeks for each layer are stored in the layer names names(abd_weekly) # they can be converted to date objects with as.Date as.Date(names(abd_weekly)) } # } ``` -------------------------------- ### Download Example Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_download_status.md Use this example to download the pre-packaged example dataset for Yellow-bellied Sapsucker. This data is smaller and does not require an access key. ```r ebirdst_download_status("yebsap-example") ``` -------------------------------- ### Download and Load Example PPM Raster Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_ppm.html Demonstrates how to download example data and load a specific PPM raster (binary_pr_auc) for analysis. Ensure example data is downloaded before loading PPMs. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example", download_ppms = TRUE) # load area under the precision-recall curve PPM raster load_ppm("yebsap-example", ppm = "binary_pr_auc") } # } ``` -------------------------------- ### Download all data coverage products Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_download_data_coverage.html This example shows how to download all available data coverage products by calling the function without any specific pattern. ```R ebirdst_download_data_coverage() ``` -------------------------------- ### Download spatial coverage products Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_download_data_coverage.html This example demonstrates how to download only the spatial coverage products by using the 'spatial-coverage' pattern. ```R ebirdst_download_data_coverage(pattern = "spatial-coverage") ``` -------------------------------- ### Download and Load Example Data in R Source: https://github.com/ebird/ebirdst/blob/main/docs/index.html This snippet demonstrates how to download example data for a specific species and load the relative abundance raster stack. It includes necessary library loading and data preparation steps. ```r library(fields) library(rnaturalearth) library(sf) library(terra) library(ebirdst) # download example data, yellow-bellied sapsucker in michigan ebirdst_download_status(species = "yebsap-example") # load relative abundance raster stack with 52 layers, one for each week abd <- load_raster("yebsap-example", resolution = "27km") # load species specific mapping parameters pars <- load_fac_map_parameters("yebsap-example") # custom coordinate reference system crs <- st_crs(pars$custom_projection) # legend breaks breaks <- pars$weekly_bins # legend labels for top, middle, and bottom labels <- pars$weekly_labels # the date that each raster layer corresponds to is stored within the labels weeks <- as.Date(names(abd)) print(weeks) ``` -------------------------------- ### Install ebirdst Package from GitHub Source: https://github.com/ebird/ebirdst/blob/main/README.md Install the ebirdst R package from GitHub. Ensure the 'remotes' package is installed first. ```r if (!requireNamespace("remotes", quietly = TRUE)) { install.packages("remotes") } remotes::install_github("ebird/ebirdst") ``` -------------------------------- ### Example: Vectorize Trends as Points and Circles Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/vectorize_trends.md Demonstrates how to download example trends data, load it, and then vectorize it as both points and abundance-scaled circles with a specified CRS. This example requires the 'ebirdst_download_trends' and 'load_trends' functions. ```r if (FALSE) { # \dontrun{ # download example trends data if it hasn\'t already been downloaded ebirdst_download_trends("yebsap-example") # load trends trends <- load_trends("yebsap-example") # vectorize as points vectorize_trends(trends, "points") # vectorize as circles vectorize_trends(trends, "circles", crs = "+proj=eqearth") } # } ``` -------------------------------- ### Review and Confirm Deletion of Example Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_delete.html This example shows how to review and confirm the deletion of example data for a specific species. When run interactively without `force = TRUE`, the function will prompt for confirmation. ```R if (FALSE) { # \dontrun{ # review and confirm deletion of example data ebirdst_delete(species = "yebsap-example") # delete all data for a given version year without prompting ebirdst_delete(year = 2021, force = TRUE) # delete a specific species and year ebirdst_delete(species = "Yellow-bellied Sapsucker", year = 2022, force = TRUE) } # } ``` -------------------------------- ### Download example data and list available PI predictors Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_pi.html This snippet demonstrates how to download example data and identify the top predictor for which PI data is available. Ensure `download_pis = TRUE` is set when calling `ebirdst_download_status()`. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example", download_pis = TRUE) # identify the top predictor top_preds <- list_available_pis("yebsap-example") print(top_preds[1, ]) ``` -------------------------------- ### Download Example eBird Status Data Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/status.html Download a simplified example dataset for Yellow-bellied Sapsucker in Michigan. This dataset is small and accessible without an access key. Use download_all = TRUE to get all available data products. ```R library(dplyr) library(sf) library(terra) library(ebirdst) # download a simplified example dataset for Yellow-bellied Sapsucker in Michigan ebirdst_download_status(species = "yebsap-example", download_all = TRUE) ``` -------------------------------- ### Download and Load Example Trends Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/vectorize_trends.html Before vectorizing, download and load example trends data for a species. This is a prerequisite for using the vectorize_trends function with sample data. ```r if (FALSE) { # \dontrun{ # download example trends data if it hasn't already been downloaded ebirdst_download_trends("yebsap-example") # load trends trends <- load_trends("yebsap-example") } ``` -------------------------------- ### Example JSON Response for File Listing Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/api.html This is an example of the JSON response received when listing available files for a species. It contains a list of file paths relative to the base download URL. ```json ["2023/woothr/config.json","2023/woothr/pis/pi_rangewide.csv","2023/woothr/pis/woothr_end_day_of_year_27km_2023.tif","2023/woothr/pis/woothr_n-folds-modeled_27km_2023.tif","2023/woothr/pis/woothr_pi_count_astwbd-c2-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_astwbd-c3-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_gsw-c2-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c11-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c12-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c14-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c15-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c21-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c22-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c31-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs1-c32-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs2-c25-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs2-c36-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs3-c27-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_count_mcd12q1-lccs3-c50-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_astwbd-c1-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_astwbd-c2-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_astwbd-c3-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_gsw-c2-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c11-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c14-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c15-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c21-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c22-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c31-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs1-c32-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs2-c25-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs2-c36-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs3-c27-pland_27km_2023.tif","2023/woothr/pis/woothr_pi_occurrence_mcd12q1-lccs3-c50-pland_27km_2023.tif","2023/woothr/pis/woothr_start_day_of_year_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-log-pearson_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-log-pearson_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-log-pearson_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-log-pearson_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-mae_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-mae_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-mae_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-mae_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-poisson-dev_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-poisson-dev_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-poisson-dev_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-poisson-dev_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-rmse_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-rmse_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-rmse_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-rmse_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-spearman_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-spearman_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-spearman_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_abd-spearman_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-f1_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-f1_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-f1_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-f1_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-mcc_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-mcc_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-mcc_sd_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-mcc_sd_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-prevalence_mean_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-prevalence_mean_raw_27km_2023.tif","2023/woothr/ppms/woothr_ppm_binary-prevalence_sd_27km_2023.tif"] ``` -------------------------------- ### Download all weeks in April Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_download_data_coverage.html This example demonstrates how to download all data coverage products for the month of April by using the pattern '04-'. ```R ebirdst_download_data_coverage(pattern = "04-") ``` -------------------------------- ### Load Smoothed Range Polygons Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_ranges.html This example demonstrates how to load smoothed range polygons for a species. It first ensures the example data is downloaded and then calls `load_ranges` specifying the species code and resolution. Note that only 27km resolution data is available for the example dataset. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # load smoothed ranges # note that only 27 km data are provided for the example data ranges <- load_ranges("yebsap-example", resolution = "27km") } # } ``` -------------------------------- ### Load Full Annual Cycle Map Parameters Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_fac_map_parameters.md Loads map parameters for displaying full annual cycle data for a given species. Ensure the ebirdst package is installed and data is downloaded if using example data. ```r load_fac_map_parameters(species, path = ebirdst_data_dir()) ``` -------------------------------- ### Download a single week of data coverage products Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_download_data_coverage.html This example shows how to download data coverage products for a specific week, using the pattern '01-04' to target the first week of April. ```R ebirdst_download_data_coverage(pattern = "01-04") ``` -------------------------------- ### Download and Load Trends Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_trends.html Demonstrates how to download example trends data and then load it. Use `fold_estimates = TRUE` to load fold-level estimates for uncertainty analysis. ```r if (FALSE) { # \dontrun{ # download example trends data if it hasn\'t already been downloaded ebirdst_download_trends("yebsap-example") # load trends trends <- load_trends("yebsap-example") # load fold-level estimates trends_folds <- load_trends("yebsap-example", fold_estimates = TRUE) } # } ``` -------------------------------- ### Load and List PI Rasters Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_pi.md Demonstrates how to download example data, identify the top predictor using `list_available_pis()`, and load the corresponding PI raster using `load_pi()` for occurrence models. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example", download_pis = TRUE) # identify the top predictor top_preds <- list_available_pis("yebsap-example") print(top_preds[1, ]) # load predictor importance raster of top predictor for occurrence load_pi("yebsap-example", top_preds$predictor[1]) } # } ``` -------------------------------- ### GNU GPL Interactive Mode Notice Source: https://github.com/ebird/ebirdst/blob/main/docs/LICENSE.html This notice should be displayed by a program when it starts in interactive mode, informing users about its licensing and warranty status. ```text Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details. ``` -------------------------------- ### Download Data for a Specific Species Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_download_status.md This example demonstrates how to download the full data package for a specific species, such as the Wood Thrush, using its species code. ```r ebirdst_download_status("woothr") ``` -------------------------------- ### Load Full Annual Cycle Map Parameters Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_fac_map_parameters.html Loads map parameters for displaying full annual cycle abundance data for a given species. Ensure example data is downloaded first if using the example species code. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # load configuration parameters load_fac_map_parameters(path) } # } ``` -------------------------------- ### Force Delete All Data for a Version Year Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_delete.md This example demonstrates how to forcefully delete all data for a given version year without an interactive confirmation prompt. Ensure `force = TRUE` is used for non-interactive sessions. ```r ebirdst_delete(year = 2021, force = TRUE) ``` -------------------------------- ### Load eBird Status Configuration Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_config.html Loads the configuration parameters for an eBird Status run. Ensure the example dataset is downloaded first using `ebirdst_download_status()`. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # load configuration parameters p <- load_config("yebsap-example") } ``` -------------------------------- ### Get Inventory of All Downloaded Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_data_inventory.html Call ebirdst_data_inventory() without arguments to get an inventory of all data packages currently downloaded to your default ebirdst data directory. ```r if (FALSE) { # \dontrun{ # inventory of all downloaded data ebirdst_data_inventory() # inventory for a specific directory ebirdst_data_inventory("/path/to/data") } # } ``` -------------------------------- ### Load Weekly Relative Abundance Raster Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_raster.md Loads weekly relative abundance data for a specified species and resolution. Requires downloading example data first. Note that the example data is only available at a 27km resolution. ```r if (FALSE) { # \dontrun{ # download example data if hasn't already been downloaded ebirdst_download_status("yebsap-example") # weekly relative abundance # note that only 27 km data are available for the example data abd_weekly <- load_raster("yebsap-example", "abundance", resolution = "27km") # the weeks for each layer are stored in the layer names names(abd_weekly) # they can be converted to date objects with as.Date as.Date(names(abd_weekly)) } ``` -------------------------------- ### List Available Files for a Species Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/api.html Use this endpoint to retrieve a list of available data files for a given species and version year. Replace placeholders with your access key, species code, and desired version year. ```http https://st-download.ebird.org/v1/list-obj/{version_year}/{species_code}?key={access_key} ``` ```http https://st-download.ebird.org/v1/list-obj/2023/woothr?key=XXXXXXXX ``` -------------------------------- ### Get Species Path Function Signature Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/get_species_path.md This is the signature of the `get_species_path` function, showing its parameters and their default values. ```r get_species_path( species, path = ebirdst_data_dir(), dataset = c("status", "trends"), check_downloaded = TRUE ) ``` -------------------------------- ### Setting Up Plotting Parameters and Background Source: https://github.com/ebird/ebirdst/blob/main/README.md Initializes plotting parameters and draws a white background with the spatial extent defined by the raster's bounding box. ```r par(mfrow = c(1, 1), mar = c(0, 0, 0, 0)) bb <- st_as_sfc(st_bbox(trim(abd_prj))) plot(bb, col = "white", border = "white") plot(wh_states, col = "#cfcfcf", border = NA, add = TRUE) ``` -------------------------------- ### Usage of grid_sample Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/grid_sample.html Demonstrates the basic usage of the `grid_sample` function for spatiotemporal grid sampling. ```R grid_sample( x, coords = c("longitude", "latitude", "day_of_year"), is_lonlat = TRUE, res = c(3000, 3000, 7), jitter_grid = TRUE, sample_size_per_cell = 1, cell_sample_prop = 0.75, keep_cell_id = FALSE, grid_definition = NULL ) ``` -------------------------------- ### Load Seasonal Abundance Data Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/applications.md Loads the seasonal relative abundance raster for a specified species. Ensure the 'ebirdst' package is installed and loaded. ```r abd_seasonal <- load_raster("goleag", product = "abundance", period = "seasonal") ``` -------------------------------- ### View ebirdst_runs Data Frame Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_runs.md This snippet shows how to access the ebirdst_runs data frame in R. Ensure the ebirdst package is installed and loaded. ```r ebirdst_runs ``` -------------------------------- ### List Available Files Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/api.md Lists all available data files for a specified species. ```APIDOC ## GET /v1/product/list ### Description Lists all available data files for a specified species. ### Method GET ### Endpoint /v1/product/list ### Parameters #### Query Parameters - **speciesCode** (string) - Required - The eBird species code for which to list files. - **regionCode** (string) - Required - The eBird region code for which to list files. - **regionType** (string) - Required - The type of region (e.g., 'country', 'state', 'species'). - **accessKey** (string) - Required - Your eBird API access key. ### Response #### Success Response (200) - **files** (array) - A list of available files, each with a 'fileName' and 'fileURL'. #### Response Example { "files": [ { "fileName": "species_file_1.zip", "fileURL": "http://example.com/data/species_file_1.zip" }, { "fileName": "species_file_2.zip", "fileURL": "http://example.com/data/species_file_2.zip" } ] } ``` -------------------------------- ### Standard GNU GPL Notice for Programs Source: https://github.com/ebird/ebirdst/blob/main/docs/LICENSE.html This is the standard notice to include at the beginning of each source file for a program distributed under the GNU General Public License. ```text Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ``` -------------------------------- ### Basic Spatiotemporal Grid Sampling Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/grid_sample.html Demonstrates basic spatiotemporal grid sampling on a generated dataset. Visualizes original and sampled data points. ```R set.seed(1) # generate some example observations n_obs <- 10000 checklists <- data.frame(longitude = rnorm(n_obs, sd = 0.1), latitude = rnorm(n_obs, sd = 0.1), day_of_year = sample.int(28, n_obs, replace = TRUE), year = NA_integer_, obs = rpois(n_obs, lambda = 0.05), forest_cover = runif(n_obs), island = as.integer(runif(n_obs) > 0.95)) # add a year column, giving more data to recent years checklists$year <- sample(seq(2016, 2020), size = n_obs, replace = TRUE, prob = seq(0.3, 0.7, length.out = 5)) # create several rare islands checklists$island[sample.int(nrow(checklists), 9)] <- 2:10 # basic spatiotemporal grid sampling sampled <- grid_sample(checklists) # plot original data and grid sampled data par(mar = c(0, 0, 0, 0)) plot(checklists[, c("longitude", "latitude")], pch = 19, cex = 0.3, col = "#00000033", axes = FALSE) points(sampled[, c("longitude", "latitude")], pch = 19, cex = 0.3, col = "red") ``` -------------------------------- ### Display Trends Run Details for a Species Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/trends.html Filters the trends_runs data to show the start and end years and dates for the trend estimates of a specific species. ```r trends_runs |> filter(common_name == "Sage Thrasher") |> select(trends_start_year, trends_end_year, trends_start_date, trends_end_date) ``` -------------------------------- ### List Available Files Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/api.html This endpoint lists all available files for a specified species code and version year. The response is a JSON array of file paths. ```APIDOC ## GET /v1/list-obj/{version_year}/{species_code}?key={access_key} ### Description Retrieves a list of available files for a given species code and version year. ### Method GET ### Endpoint /v1/list-obj/{version_year}/{species_code} ### Parameters #### Path Parameters - **version_year** (string) - Required - The year for which to list files (e.g., '2023'). - **species_code** (string) - Required - The 6-letter eBird species code (e.g., 'woothr'). #### Query Parameters - **key** (string) - Required - The user-specific access key. ### Response #### Success Response (200) - **Array of strings**: A JSON array where each string is a path to an available file. ### Response Example ```json [ "2023/woothr/config.json", "2023/woothr/pis/pi_rangewide.csv", "2023/woothr/pis/woothr_end_day_of_year_27km_2023.tif" ] ``` ``` -------------------------------- ### List Available Files Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/api.html This endpoint allows users to list all available data files for a specific species. It requires an access key and the species code. ```APIDOC ## GET /v1/status/files ### Description Lists available data files for a given species. ### Method GET ### Endpoint /v1/status/files ### Parameters #### Query Parameters - **access_key** (string) - Required - Your eBird API access key. - **species_code** (string) - Required - The eBird species code (e.g., 'amegof1'). ### Response #### Success Response (200) - **files** (array of objects) - A list of available files, each with a `file_name` and `file_url`. ### Response Example { "files": [ { "file_name": "species_file_1.zip", "file_url": "https://example.com/data/species_file_1.zip" }, { "file_name": "species_file_2.zip", "file_url": "https://example.com/data/species_file_2.zip" } ] } ``` -------------------------------- ### Rasterize eBird Trends Data Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/rasterize_trends.html Demonstrates how to download, load, and rasterize eBird trends data for a specific species. Ensure the example data has been downloaded before running. ```R if (FALSE) { # \dontrun{ # download example trends data if it hasn\'t already been downloaded ebirdst_download_trends("yebsap-example") # load trends trends <- load_trends("yebsap-example") # rasterize percent per year trend rasterize_trends(trends, "abd_ppy") } # } ``` -------------------------------- ### Inspect eBird Trends Time Period Source: https://github.com/ebird/ebirdst/blob/main/docs/articles/trends.md Filter and select columns from the trends_runs data frame to determine the start and end years and dates for the trend estimates. ```r trends_runs |> filter(common_name == "Sage Thrasher") |> select(trends_start_year, trends_end_year, trends_start_date, trends_end_date) ``` -------------------------------- ### Load Single Week of Site Selection Probability Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/load_data_coverage.html Loads a single week's data for the site selection probability product. Ensure data is downloaded first. ```r load_data_coverage("selection-probability", weeks = "01-04") ``` -------------------------------- ### Get eBird Status and Trends Data Inventory Source: https://github.com/ebird/ebirdst/blob/main/docs/reference/ebirdst_data_inventory.md Returns a tibble summarizing all downloaded eBird Status and Trends data packages. Use this to check available data on disk. ```r ebirdst_data_inventory(path = ebirdst_data_dir()) ```