Learn R Programming

r2country (version 2.0.2.4.0)

continentOf: Fetch the continent of a country

Description

Get the continent that a particular country belongs to

Usage

continentOf

Arguments

Value

a list containing all countries and corresponding continents

Format

An object of class list of length 193.

Examples

Run this code
# view the searchable countries, return first 15
names(continentOf)[1:15]

#task 1: view the continent of algeria
continentOf$algeria

#task 2: view the continent of nigeria
continentOf$nigeria

#task 3: view the continent of multiple countries
continentOf[c("niger","china","colombia")]

#task 4: if the continent is not available
continentOf[c("niger","china","randomtest")]

Run the code above in your browser using DataLab