countryStartsWith: Fetch countries that start with specified characters

View source: R/subsetted.R

countryStartsWithR Documentation

Fetch countries that start with specified characters

Description

Subset and return countries given a specified characters to search

Usage

countryStartsWith(char, full.list = TRUE)

Arguments

char

character to search for

full.list

whether to return only name of country or full list

Value

country data list matching a specified character

See Also

[countryEndsWith()] for country search ending in specified character, and [countryHas()] for countries that contain specified characters.

Examples

# task 1: get only names of countries that start with "A" or "a"
# note that the search in case-insensitive
countryStartsWith("A", full.list = FALSE)

# task 2: get only names of countries that start with "No" or "no"
countryStartsWith("no", full.list = FALSE)

# task 3: repeat task 2, but return full list for each country
countryStartsWith("no")


r2country documentation built on Sept. 11, 2024, 9:24 p.m.