Learn R Programming

r2country (version 2.0.2.4.0)

languageStartsWith: Fetch countries data based on official language prefix

Description

Obtain country data matching language first one or more letters

Usage

languageStartsWith(char, full.list = TRUE)

Value

language list or country data list matching parts of a character search on languages

Arguments

char

character to search in languages

full.list

whether to return only name of country or full list

See Also

countryStartsWith for country search starting with specified characters, and [countryEndsWith()] for countries that end with a specified characters.

Examples

Run this code
# task 1: get only language names that ends with "EN" or "en"
# note that the search in case-insensitive
languageStartsWith("eN", full.list = FALSE)

# task 2: get only language names that ends with "chi"
languageStartsWith("chi", full.list = FALSE)

# task 3: repeat task 2, but return full list for each country with the language
languageStartsWith("sin", full.list = TRUE)

# searching text with no results
languageStartsWith("er", full.list = FALSE)

Run the code above in your browser using DataLab