## SOURCE("fBasics.11A-MarketStatistics")
## 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])
OilProduction
pie(OilProduction,col = rainbow(10))
title(main = "Oil Production 2004
bbl/day")
mtext("Source: CIA World Factbook", side = 1)
## Barplot from WFE Capitalization Statistics:
# Extract Capitalization of/at:
# NYSE: 7, Tokyo: 37, London: 22, Frankfurt: 15
# 1991 - 2003 triannual: 3,6,9,12,15
data(wfe1)
Table =t(wfe1[c(7,37,22,15),c(3,6,9,12,15)])/1e6
colnames(Table) = c("NewYork", "Tokyo", "London", "Frankfurt")
rownames(Table) = as.character(seq(1991, 2003, by = 3))
Table
# Create Barplot:
barplot(Table, beside = TRUE, legend = rownames(Table),
col = c("lightblue", "mistyrose", "lightcyan", "lavender", "cornsilk"))
title(main = "Stock Market Capitalization
1991 - 2003")
mtext("Source: World Federation of Exchanges", side = 4,
line = -2, cex = 0.7)
Run the code above in your browser using DataLab