| oly12 | R Documentation |
Individual data for the Summer 2012 Olympic Games.
data(oly12)
A data frame with 10384 observations on the following 14 variables.
NameThe individual competitor's name.
CountryCountry.
AgeA numeric vector, age in years.
HeightA numeric vector, height in m.
WeightA numeric vector, weight in kg.
SexA factor with levels F and M.
DOBA Date, date of birth.
PlaceOBPlace of birth.
GoldNumeric vector, number of such medals won.
Silver Similar to Gold.
Bronze Similar to Gold.
TotalA numeric vector, total number of medals.
SportA factor with levels
Archery,
Athletics,
Athletics,
Triathlon,
Badminton, etc.
EventThe sporting event.
This data set represents a very small modification of a
.csv spreadsheet from the source below.
Height has been converted to meters,
and date of birth is of a "Date" class
(see as.Date).
A few non-ASCII characters have been replaced by some ASCII sequence
(yet to be fixed up properly).
Some competitors share the same name. Some errors in the data are likely to exist.
Downloaded from
http://www.guardian.co.uk/sport/series/london-2012-olympics-data
in 2013-03; more recently it has changed to
https://www.theguardian.com/sport/series/london-2012-olympics-data.
data(oly12)
mtab <- with(oly12, table(Country, Gold))
(mtab <- head(sort(mtab[, "1"] + 2 * mtab[, "2"], decreasing = TRUE), 10))
## Not run:
barplot(mtab, col = "gold", cex.names = 0.8, names = abbreviate(names(mtab)),
beside = TRUE, main = "2012 Summer Olympic Final Gold Medal Count",
ylab = "Gold medal count", las = 1, sub = "Top 10 countries")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.