CIAFactbook: CIA Factbook

CIAFactbookR Documentation

CIA Factbook

Description

A collection and description of functions to extract financial and economic market statistics from the data available in the CIA World Factbook.

The functions are:

ciaCountries Returns a list of CIA country codes,
ciaIndicators Returns a list of CIA indicator codes,
ciaByCountry Returns all Indicators by country,
ciaByIndicator Returns for all countries indicator ranking.

Usage

ciaCountries()
ciaIndicators()

ciaByCountry(code = "CH", from = FALSE, names = FALSE, details = FALSE)
ciaByIndicator(code = 2001, from = FALSE, details = FALSE)

## S3 method for class 'ciaCountries'
print(x, ...)
## S3 method for class 'ciaIndicators'
print(x, ...)

Arguments

code

[ciaByCountry] -
a character string denoting the country code.
[ciaByIndicator] -
a character string or integer denoting the indicator code.

details

a logical flag. Should details be printed? By default FALSE.

from

a logical flag. If set to TRUE an additional column will be returned with the information when the data were recorded.

names

a logical flag. If set to TRUE then the full names of the countries will be returned in an additional column

x

x an object of class ciaCountries or ciaIndicators as returned by the functions ciaCountry or ciaIndicator, respectively.

...

arguments to be past to the print method.

Value

ciaCountries
returns a data frame with countries and contry codes.

ciaIndicators
returns a data frame with indicator codes.

ciaByCountry
returns a data frame with indicators by country.

ciaByIndicator
returns a data frame with ranked data for a given indicator.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

References

CIA, 2004, CIA Factbbook 2004, http://www.cia.gov/cia/publications/factbook.

Examples

## Pie Chart from CIA Oil Production Indicator (Code 2173): 
   # Search for Code:
   ciaIndicators()
   # Create Pie Chart:
   OilProduction = as.integer(as.vector(ciaByIndicator(2173)[2:11, 2]))
   names(OilProduction) = as.vector(ciaByIndicator(2173)[2:11,1])
   print(OilProduction) 
   pie(OilProduction, col = rainbow(10))
   title(main = "Oil Production 2004\n bbl/day")
   mtext("Source: CIA World Factbook", side = 1)

fEcofin documentation built on Sept. 9, 2022, 3:01 p.m.

Related to CIAFactbook in fEcofin...