get_countries: Get World Countries Listed by the UNEP-WCMC

Description Usage Arguments Value See Also Examples

View source: R/get_countries.R

Description

This function gets the list of world countries listed by the UNEP-WCMC using the Protected Planet API https://api.protectedplanet.net/.

Usage

1
get_countries(sleep = 0, key = "WDPA_KEY")

Arguments

sleep

a numeric specifying the time interval (in seconds) to suspend between each API request.

key

a character providing the WDPA token name stored in the .Renviron file. Default is WDPA_KEY.

Value

A data frame with the following information (columns) for each World countries (rows):

region_name

the name of the region

region_iso2

the ISO-2 code of the region

country_name

the name of the country

country_iso3

the ISO-3 code of the country

pas_count

the number of protected areas per country

See Also

wdpa_countries, get_wdpa

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
## List World Countries ----
countries <- worldpa::get_countries(sleep = 0.25)
head(countries)

##   region_name region_iso2 country_name country_iso3 pas_count
## 1      Africa          AF      Algeria          DZA        78
## 2      Africa          AF       Angola          AGO        14
## 3      Africa          AF        Benin          BEN        64
## 4      Africa          AF     Botswana          BWA        22
## 5      Africa          AF Burkina Faso          BFA       112
## 6      Africa          AF      Burundi          BDI        21

## End(Not run)

FRBCesab/worldpa documentation built on Feb. 26, 2021, 2:38 a.m.