tests/testthat/helper.R

# Most things in this package depend on the birdmap API being reachable
skip_if_offline(host = "api.birdmap.africa")

# Selection of species to test
spp <- c(101, 100, 104, 1017, 89, 886, 1270, 98, 93, 1274, 97, 99, 1016, 885, 94,
         95, 96, 1292, 1296, 1298, 978, 1300, 1304, 884, 102, 1332, 92, 103, 88,
         91, 90, 1342, 397, 396, 402, 1560, 400, 394, 395, 360, 361, 370, 216, 214,
         215, 213, 200, 203, 199, 198, 212, 211, 210, 893, 208, 209, 201, 202, 197,
         204, 892, 205, 258, 232, 255, 896, 252, 254, 251, 997, 895, 253, 897, 972,
         985, 249, 250, 981, 1009, 266, 265, 267, 268, 271, 272, 256, 929, 260,
         1014, 264, 1008, 263, 259, 262, 261, 926, 257, 230, 228, 229, 864, 274,
         55, 57, 883, 62, 65, 71, 61, 63, 58, 60, 64, 1015, 2188, 59, 2190, 982,
         70, 67, 2194, 66, 69, 2196, 72, 87, 86, 84, 85, 83, 81, 42, 41, 74, 78,
         80, 77, 79, 75, 73, 76, 2, 14, 16, 29, 685, 686, 690, 688, 689, 10004,
         10005, 10006, 10015, 10007, 10008, 10014, 10009, 10010, 10011, 10012,
         4136, 4137, 10003, 10016, 4150, 10034, 14206, 14229, 9638)

# Selectin of sites to test
sites_za <- as.character(
  c(29072437, 25302712, 25442718, 33571839, 26192828, 34401952, 32482711,
    28402446, 34391953, 31391811, 32361817, 32051818, 32041818, 32031818,
    27562445, 27572957, 27592446, 28033217, 28042433, 28043227, 28053218,
    33582505, 33592239, 33592240, 33592241, 33592243, 33592332, 34002245,
    34002456, 34012252, 34012323, 34012541, 34021913, 34032302, 34042257,
    34042302, 34051831, 34051849, 34052440, 34052450, 34052454, 34061828,
    34061849, 34071902, 34072206, 34081821, 34082450, 34101854, 34162149,
    34211905, 34211906, 34021830, 26072816, 25213022, 30512359, 30412402,
    29422405, 33191952, 33392225, 33382209, 33372214, 34211859, 30342952,
    32511814, 34262023, 34432007, 25382821, 25392820, 28492558, 27372636,
    28392608, 30552416, 29542434, 30202500, 31082408, 27023031, 33422035,
    34222100, 34232125, 34212153, 34431958, 27482244, 33381849, 28462436,
    29062437, 28412426, 23573102, 33522536, 33502532, 24013110, 25262919,
    25533150, 24333048, 25462947, 24103100, 33312237, 32481813, 29182651,
    29102545, 29082541, 28502635, 34042214, 34071828, 23153110, 33592227,
    34062200, 32132432, 31302842, 23372923, 24362924, 23532946, 23472924,
    23472927, 26522005, 34051844, 32572158, 29072616, 28482637, 28462606,
    28263217, 30042639, 22132916, 26132726, 26192720, 26212716, 31562525,
    32262424, 32442607, 28153225, 30283038, 26082816, 26092816, 26112817,
    26112741, 34112201, 34071827, 34061829, 28463124, 28383217, 28482449,
    29522403, 29522412, 26032822, 26072815, 30081806, 29532412, 27533101,
    27333239, 27413236, 27393238, 24033119, 33461845, 26092832, 24152858,
    25582810, 27213257, 30573017, 27012655, 29162619, 34042304, 34042301))

sites_ke <- listCwacSites("country", "kenya")

sites_ke <- unique(sites_ke$LocationCode)

paste(sites_ke, collapse = "', '")

sites_ke <- c('03193958', '03094008', '03124002', '02594009', '03134007',
              '01143701', '03113954', '02284021', '02354020', '00453621', '03153958',
              '03064002')

# Selection of years to test
years <- 1994:2022
AfricaBirdData/CWAC documentation built on Aug. 5, 2024, 12:40 a.m.