Skip to contents

Returns ISO3 codes for countries belonging to specified categories. Supports complex queries including category exclusions.

Usage

wp_get_category(input, verbose = TRUE)

Arguments

input

Character vector of category codes or ISO3 country codes. Can include exclusion patterns (e.g., "EUROPE-DEU" for European countries excluding Germany).

verbose

Logical, whether to print reminder messages about specific countries (default: TRUE)

Value

Character vector of ISO3 country codes belonging to the specified categories

Details

Categories include:

  • Economic: CTR_LDR, CTR_FOL, SMP_WLD, SMP_RLD, SMP_FOL, PERI

  • Regional: AFRICA, AMERICAS, ASIA, EUROPE, OCEANIA

  • Subregional: NORTH_AFRICA, WEST_ASIA, etc.

  • Groups: BRICS, EU, ASEAN, etc.

  • Resources: NRS_REN, HYD_EXP, HYD_IMP

See also

wp_from_iso for getting specific information about countries, wp_ctry2iso for converting country names to ISO codes

Other country classification functions: wp_from_iso()

Examples

# Get all center countries
center_countries <- wp_get_category("CTR")
#> Reminder: Notable exclusions from CTR/SMP categories:
#> - South Korea (KOR)
#> - Singapore (SGP)
#> - Taiwan (TWN)
#> Consider if these should be included in your analysis.
#> 

# Get European countries excluding Germany
europe_except_germany <- wp_get_category("EUROPE-DEU")

# Get multiple categories
brics_and_eu <- wp_get_category(c("BRICS", "EU"))