Last active
August 29, 2015 13:55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.theguardian.com/news/reality-check/2014/jan/31/sex-guardian-readers-confess-all | |
# Source: https://docs.google.com/spreadsheet/ccc?key=0At6CC4x_yBnMdDduelJocVo5RDZzalltd0dSQzdXUmc&usp=sharing#gid=0 | |
dat <- data.frame(AgeGroup=factor( | |
1:9, | |
labels= c("Younger than 16", "16-24", | |
"25-34", "35-44", "45-54", | |
"55-64", "65-74", | |
"Older than 74", "(blank)"), | |
ordered=TRUE), | |
No=c(34, 2079, 2585, 1593, | |
1274, 802, 291, 78, 13), | |
Yes=c(18, 1970, 4035, 2328, | |
1707, 924, 386, 68, 4)) | |
library(latticeExtra) | |
asTheEconomist( | |
barchart(Yes + No ~ AgeGroup, dat, | |
auto.key=list(columns=2, space="top"), | |
main="Did you have sex in the last 4 weeks?\n"), | |
xlab="Age group", | |
ylab="Number of responses from Guardian data blog readers" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment