Extract raw data from the Africa Bird Atlas

extract_all(start_date = "2019-01-01", end_date = "2019-02-01",
  region_type = "country", region_id = "kenya", return_type = "data",
  return_format = "CSV")

Arguments

start_date

A character representing the start date from which you want to query the database. It must be in the YYYY-MM-DD format. Defaults to 1 Jan,2019. Example: '2019-01-26'.

end_date

A character representing the end date to which you want to query the database. It must be in the YYYY-MM-DD format. Defaults to 1 Feb, 2019. Example: '2019-02-26'.

region_type

Can take one of the following types: country, pentad, group, qdgc. Default is 'country'

region_id

Has to be co-defined with `region_type`. That is, it is an instantiation of the `region_type`. For instance if the `region_type` = 'country', then the `region_id` = 'kenya'. Or if `region_type` = 'pentad', then `region_id` = '3355_1825'. Default is 'kenya'.

return_type

There are two options, 'data' and 'count'. 'data' is the actual records submitted to the africa bird map. 'count' return a count of the rows. Default is 'data'.

return_format

Default s 'CSV', though the API default is 'JSON'

Value

Depending on the return_format, the function will return a dataframe with the following: 1. `return_type = data` A tidy dataframe is returned with the records that fall within the specification defined. 2. `return_type = count` A tidy dataframe is returns with the number of rows that will be produced if the return_type was to be specified as 'data'.

Examples

# extract data for all of Kenya for Jan 2019 extract_all( start_date = '2019-01-01', end_date = '2019-02-01', region_type = 'country', region_id = 'kenya', return_type = 'data', return_format = 'CSV')
#> # A tibble: 4,712 x 27 #> CardNo StartDate EndDate StartTime Pentad ObserverNo ObserverName #> <chr> <date> <date> <time> <chr> <dbl> <chr> #> 1 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 2 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 3 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 4 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 5 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 6 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 7 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 8 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 9 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> 10 0055_~ 2019-01-25 2019-01-27 15:54 0055_~ 10723 Dr C Jackson #> # ... with 4,702 more rows, and 20 more variables: TotalHours <dbl>, #> # Hour1 <dbl>, Hour2 <dbl>, Hour3 <dbl>, Hour4 <dbl>, Hour5 <dbl>, #> # Hour6 <dbl>, Hour7 <dbl>, Hour8 <dbl>, Hour9 <dbl>, Hour10 <dbl>, #> # TotalSpp <dbl>, InclNight <dbl>, AllHabitats <dbl>, Spp <dbl>, #> # Common_group <chr>, Common_species <chr>, Genus <chr>, Species <chr>, #> # Sequence <dbl>