Learn R Programming

r2country (version 2.0.2.4.0)

byContinent: Fetch countries by continent

Description

Obtain country data matching language first one or more letters

Usage

byContinent(
  name = c("asia", "europe", "africa", "north america", "south america", "oceania"),
  full.list = TRUE
)

Value

country data list matching continent

Arguments

name

name of continent

full.list

whether to return only name of country or full list

Details

Note that choices for names of continent includes 'asia','europe','africa','north america','south america','oceania'

Examples

Run this code
# task 1: get only names of countries that contains with "africa" or "AFrica"
# note that the search in case-insensitive
byContinent("africa", full.list = FALSE)

# task 2: get only names of countries that contains with "ASIA" or "asia"
byContinent("asia", full.list = FALSE)

# task 3: repeat task 2, but return full list for each country
byContinent("europe", full.list = TRUE)

Run the code above in your browser using DataLab