Skip to main content

GapAnalysis: An R package to calculate conservation indicators using spatial information

Cite this dataset

Ramirez-Villegas, Julian et al. (2021). GapAnalysis: An R package to calculate conservation indicators using spatial information [Dataset]. Dryad.


Effective assessments of the current status of biodiversity conservation are needed to support planning, policy, and action, from local to global levels. Of particular use would be well documented, reproducible methods based on openly accessible data and tools. Such methods should provide an accurate estimate of the state of conservation of diversity, identifying gaps in current conservation systems, while providing a benchmark against which to measure success, including determining when conservation goals have been met. Here we introduce GapAnalysis, an open source R package developed to support the assessment of the state of conservation of taxa, both ex situ (in genebanks, botanic gardens, and other repositories) and in situ (in protected natural areas). The eco-geographic variation maintained in conservation repositories and that present within protected natural areas is compared with the full extent of eco-geographic variation predicted within species’ native ranges. Eco-geographic conservation gaps are identified, and taxa are then prioritized for further action. The package enables users to quickly determine conservation status, gaps, and priorities for as few as one to as many as thousands of taxa, for any wild flora or fauna for which occurrence data and species distribution models are available. To demonstrate the use of GapAnalysis, we provide case studies for wild plant taxa in the genera Capsicum L. and Cucurbita L, with an accompanying online R tutorial for three of the Cucurbita species.


The methods for compiling the occurrence data, performing species distribution modeling, and conducting GapAnalysis for these taxa are described in full in Khoury et al. (2019a, b). In short, occurrence data were drawn from biodiversity and conservation repository databases and from the authors’ own botanical explorations. Duplicates and non-wild records were removed, taxonomic names were standardized, and records were classified as H (reference) or G (ex situ sample) as per the definitions described in this paper (see Input data). Species distributions were produced with the MaxEnt algorithm (Phillips et al. 2017) using 26 climatic and topographic predictors (Jarvis et al, 2008, Fick and Hijmans 2017) at a spatial resolution of 2.5 arc-minutes, employing a subset of variables as well as number and location of pseudo-absences specific to each taxon. The occurrence data, models, and full results are available at Khoury et al. (2019c, d). A GapAnalysis R tutorial for three of the Cucurbita species is provided in the usage section of the GapAnalysis GitHub repository ( and included as an example in the R package itself. Note that the three-species R package tutorial uses a lower spatial resolution for efficiency (10 arc-min vs. 2.5 arc-min), and hence the GapAnalysis results differ from those described below and in Khoury et al. (2019a, b).


Jarvis A., Reuter, H. I., Nelson, A. and Guevara, E. 2008. Hole-filled seamless SRTM data V4, International Center for Tropical Agriculture (CIAT),

Khoury, C. K., Carver, D., Barchenger, D. W., Barboza, G., van Zonneweld, M., Jarret, R., Bohs, L., Kantar, M. B., Uchanski, M., Mercer, K., Nabhan, G. P., Bosland, P. W. and Greene, S. L. 2019a. Modeled distributions and conservation status of the wild relatives of chile peppers (Capsicum L). - Diversity and Distributions 26(2): 209-225. doi: 10.1111/DDI.13008.

Khoury, C. K., Carver, D., Kates, H. R., Achicanoy, H. A., van Zonneweld, M., Thomas, E., Heinitz, C., Jarret, R., Labate, J. A., Reitsma, K., Nabhan, G. P. and Greene, S. L. 2019b. Distributions, conservation status, and abiotic stress tolerance potential of wild cucurbits (Cucurbita L.). - Plants, People, Planet 2(3): 269-283. doi: 10.1002/ppp3.10085.

Phillips, S. J., Anderson, R. P., Dudik, M., Schapire, R. E. and Blair, M. E. 2017. Opening the black box: an open-source release of Maxent. - Ecography 40: 887-893.


Consortium of International Agricultural Research Centers, Award: A311 / Gap analysis

National Institute of Food and Agriculture, Award: 19-67012-29733/project accession no. 1019405