| Title: | Reference Data and Helpers for Small Island States and Territories |
|---|---|
| Description: | A curated reference list of countries and territories with classifications for Small Island Developing States (SIDS), sub-national island jurisdictions (SNIJ), World Bank region and income group, and political association. Sub-sovereign cases such as Aruba, Curacao, Bonaire, Sint Maarten, the French overseas territories, and Aaland Islands are represented with disambiguating codes that standard country-code packages often collapse or omit. Provides predicate helpers and a tidy joiner intended to extend rather than replace 'countrycode'. Source data is maintained at <https://github.com/University-of-Aruba/island-research-reference-data> and licensed CC BY 4.0. |
| Authors: | Rendell de Kort [aut, cre] (ORCID: <https://orcid.org/0009-0006-5402-0500>), University of Aruba [cph, fnd] (Digital Competence Dutch Caribbean (DCDC) Network) |
| Maintainer: | Rendell de Kort <[email protected]> |
| License: | CC BY 4.0 |
| Version: | 0.1.1 |
| Built: | 2026-05-15 22:02:12 UTC |
| Source: | https://github.com/cran/islandcodes |
Left-joins selected columns from islands onto an
existing data frame, matching on a column of country names or ISO
codes. Designed for tidy pipelines but written in base R, so it works
with plain data frames, tibbles, and (read-only) data.tables.
add_island_cols( .data, code_col, cols = c("iso_code", "is_sids", "is_snij", "sids_tier", "political_association", "wb_region", "wb_income_group") )add_island_cols( .data, code_col, cols = c("iso_code", "is_sids", "is_snij", "sids_tier", "political_association", "wb_region", "wb_income_group") )
.data |
A data frame. |
code_col |
String. Name of the column in |
cols |
Character vector of columns from |
.data with the requested columns appended. Rows whose
code_col value cannot be resolved get NA in the new
columns.
df <- data.frame( country = c("Aruba", "Curacao", "Bonaire", "Brazil"), gdp = c(3.5, 3.1, 0.5, 1900) ) add_island_cols(df, "country")df <- data.frame( country = c("Aruba", "Curacao", "Bonaire", "Brazil"), gdp = c(3.5, 3.1, 0.5, 1900) ) add_island_cols(df, "country")
A convenience wrapper around island_lookup with Aruba
as the default. Calling aruba() returns Aruba's classification
row; passing another country or ISO code returns that one instead.
aruba(x = "Aruba", quiet = getOption("islandcodes.aruba.quiet", FALSE))aruba(x = "Aruba", quiet = getOption("islandcodes.aruba.quiet", FALSE))
x |
A character vector of country names or ISO codes. Defaults
to |
quiet |
Logical. If |
Named in homage to Edward Cheung, the Aruban engineer at NASA Goddard who designed A.R.U.B.A. (the ASCS/NCS Relay Unit Breaker Assembly) installed on the Hubble Space Telescope during the 2002 servicing mission. Cheung engineered the backronym specifically so children in his home country would have something concrete to point to on the telescope. We borrowed the trick. His ARUBA cuts power to Hubble's instruments when there is a fault; ours returns a row of classification data. Both spell Aruba.
A data frame with one row per element of x (the same
shape as island_lookup).
aruba() aruba("Curacao") aruba(c("AW", "BQ-BO", "CW"))aruba() aruba("Curacao") aruba(c("AW", "BQ-BO", "CW"))
Predicate helpers that return a logical vector aligned with the input.
is_sids(x) is_snij(x) is_small_island(x)is_sids(x) is_snij(x) is_small_island(x)
x |
A character vector of ISO codes or country names. |
Inputs are resolved in three passes: direct match against the
iso_code column of islands, then a case-insensitive
match against name, then a fallback through
countrycode from "country.name" to
"iso2c". Unresolved entries return NA.
Hyphenated codes ("BQ-BO" for Bonaire, "BQ-SE" for
Sint Eustatius, "BQ-SA" for Saba) are accepted directly. Bare
"BQ" is ambiguous within the bundled dataset; pass the
specific island code or the country name instead.
A logical vector the same length as x.
is_sids(c("Aruba", "Curacao", "Bonaire", "Brazil")) is_snij(c("Aruba", "Curacao", "Bonaire", "Brazil")) is_small_island(c("AW", "CW", "BQ-BO", "BR", "AX"))is_sids(c("Aruba", "Curacao", "Bonaire", "Brazil")) is_snij(c("Aruba", "Curacao", "Bonaire", "Brazil")) is_small_island(c("AW", "CW", "BQ-BO", "BR", "AX"))
Returns the matching rows of islands for a vector of
country names or ISO codes. Useful when you want more than a single
classification and want to keep the original input order, including
NA rows for unresolved inputs.
island_lookup(x, fields = NULL)island_lookup(x, fields = NULL)
x |
A character vector of ISO codes or country names. |
fields |
Optional character vector of column names to return. If
|
A data frame with one row per element of x. Rows that
could not be resolved are filled with NA.
island_lookup(c("Aruba", "Bonaire", "Brazil")) island_lookup(c("AW", "BQ-BO"), fields = c("name", "is_sids", "is_snij"))island_lookup(c("Aruba", "Bonaire", "Brazil")) island_lookup(c("AW", "BQ-BO"), fields = c("name", "is_sids", "is_snij"))
A curated dataset of 251 countries and territories, including sub-sovereign island jurisdictions (Aruba, Curacao, Bonaire, Sint Maarten, the French overseas collectivities, Aaland Islands, and others) that are typically collapsed or omitted by ISO 3166-1 country-code lists.
islandsislands
A data frame with 251 rows and 13 columns:
Short common name (e.g. "Aruba", "Curacao", "Bonaire").
Display label, used by the upstream XLSForm survey.
ISO 3166-1 alpha-2 code, with hyphenated extensions
for the three BES islands (BQ-BO Bonaire, BQ-SE
Sint Eustatius, BQ-SA Saba) so they can be distinguished
within the shared BQ prefix.
World Bank region.
World Bank income group.
Sovereign power for non-independent
territories; "Independent" otherwise.
1 if a UN-DESA recognised Small Island Developing State (member or associate); 0 otherwise.
"Sovereign member", "Associate member",
or NA where not applicable.
1 if a sub-national island jurisdiction; 0 otherwise.
1 if meets the small-population/small-area criterion; 0 otherwise.
1 if an island or archipelago; 0 otherwise.
1 if classified as developing; 0 otherwise.
1 if a sovereign state; 0 otherwise.
University of Aruba, Digital Competence Dutch Caribbean (DCDC) Network. island-research-reference-data, CC BY 4.0. https://github.com/University-of-Aruba/island-research-reference-data
head(islands) # SIDS by World Bank region table(islands$wb_region[islands$is_sids == 1]) # Dutch Kingdom territories (an example of the SNIJ axis) islands[islands$political_association == "Dutch Kingdom", c("name", "iso_code", "is_sids", "is_snij")]head(islands) # SIDS by World Bank region table(islands$wb_region[islands$is_sids == 1]) # Dutch Kingdom territories (an example of the SNIJ axis) islands[islands$political_association == "Dutch Kingdom", c("name", "iso_code", "is_sids", "is_snij")]
Convenience wrapper around islands that returns the
subset matching commonly used small-island filters.
small_islands(sids_only = FALSE, snij_only = FALSE, criteria = NULL)small_islands(sids_only = FALSE, snij_only = FALSE, criteria = NULL)
sids_only |
Logical. If |
snij_only |
Logical. If |
criteria |
Optional named logical vector with elements drawn
from |
A data frame, the relevant subset of islands.
nrow(small_islands(sids_only = TRUE)) nrow(small_islands(snij_only = TRUE)) small_islands(criteria = c(small = TRUE, island = TRUE))nrow(small_islands(sids_only = TRUE)) nrow(small_islands(snij_only = TRUE)) small_islands(criteria = c(small = TRUE, island = TRUE))