CIAFactbook | R Documentation |
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. |
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, ...)
code |
[ciaByCountry] - |
details |
a logical flag. Should details be printed? By default
|
from |
a logical flag. If set to |
names |
a logical flag. If set to |
x |
x an object of class |
... |
arguments to be past to the |
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.
Diethelm Wuertz for the Rmetrics R-port.
CIA, 2004, CIA Factbbook 2004, http://www.cia.gov/cia/publications/factbook.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.