getAbapData: Download data from ABAP cards for a region and species

View source: R/getAbapData.R

getAbapDataR Documentation

Download data from ABAP cards for a region and species

Description

Download data from ABAP cards for a region and species

Usage

getAbapData(
  .spp_code,
  .region_type = c("country", "province", "pentad", "group"),
  .region,
  .years = NULL,
  .adhoc = FALSE
)

Arguments

.spp_code

Character string or integer corresponding to the SAFRING code of the species of interest. See searchAbapSpecies.

.region_type

The type of region we are interested on. Four options: "country", "province", "pentad" and "group". See details.

.region

A character string corresponding to the specific region we are interested in. It can be either a country in Southern Africa, a South African province or a pentad code.

.years

A numeric vector with elements corresponding to the years we want data for.

.adhoc

If TRUE, only ad-hoc lists are returned. If FALSE (default), no ad-hoc lists are returned.

Details

At the moment, ABAP serves data from eleven countries: South Africa, Botswana, eSwatini, Lesotho, Malawi, Mozambique, Namibia, Zambia, Zimbabwe, Kenya and Nigeria. Only South African provinces are available: Western Cape, Eastern Cape, Northern Cape, Free State, Limpopo, Mpumalanga, KwaZulu-Natal, Gauteng, and Northwest Province.

If we specify "group" in the .region argument the function returns all records for a specific group of pentads. Groups of pentads must be created from the birdmap.africa websites (e.g., SABAP2 or Kenya Bird Map). You will need to create an account. Once logged in, you can create groups from the coverage menu. Then, these groups can be viewed from you home menu. The name of the group is the last part of the URL displayed in the browser's navigation bar. For example, I created a group named "test_group", and the URL for this group is ⁠https://kenya.birdmap.africa/coverage/group/xxxx_tst_grp⁠. The group name that we need to pass on to the getAbapData() function is xxxx_tst_grp, the last part of the URL, where xxxx is your citizen scientist number (provided when creating an account).

Value

A tibble in which each row corresponds to one ABAP card. The column 'Spp' gives either the code of the species of interest, if it was detected in that card, or "-" if it wasn't. See abap_visit_vars for more information about the columns.

Examples

getAbapData(123, .region_type = "country", .region = "South Africa")
getAbapData(169, .region_type = "province", .region = "Eastern Cape", .years = 2008)
getAbapData(95, .region_type = "pentad", .region = "2505_2850", .years = c(2008, 2009))

AfricaBirdData/ABAP documentation built on Aug. 4, 2024, 4:41 p.m.