# NOT RUN {
summary(olym08)
summary(olym12)
## maybe str(olym08) ; plot(olym08) ...
# }
# NOT RUN {
par(mfrow = c(1, 2))
myylim <- c(0, 55)
with(head(olym08, n = 8),
barplot(rbind(gold, silver, bronze),
col = c("gold", "grey", "brown"), # No "silver" or "bronze"!
# "gold", "grey71", "chocolate4",
names.arg = country, cex.names = 0.5, ylim = myylim,
beside = TRUE, main = "2008 Summer Olympic Final Medal Count",
ylab = "Medal count", las = 1,
sub = "Top 8 countries; 'gold'=gold, 'grey'=silver, 'brown'=bronze"))
with(head(olym12, n = 8),
barplot(rbind(gold, silver, bronze),
col = c("gold", "grey", "brown"), # No "silver" or "bronze"!
names.arg = country, cex.names = 0.5, ylim = myylim,
beside = TRUE, main = "2012 Summer Olympic Final Medal Count",
ylab = "Medal count", las = 1,
sub = "Top 8 countries; 'gold'=gold, 'grey'=silver, 'brown'=bronze"))
# }
Run the code above in your browser using DataLab