Created
May 2, 2010 23:06
-
-
Save ats/387537 to your computer and use it in GitHub Desktop.
Quick stab at tracking specific names in the baby names data
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
# 2010-05-02 baby name exploration | |
# data from http://github.com/hadley/data-baby-names/ | |
bnames <- read.csv("~/data/data-baby-names/baby-names.csv") // path to data | |
library(ggplot2) | |
wantedNames <- c("Page", "Plant") // set a list of names to plot over time | |
gotNames <- subset(bnames, bnames$name %in% wantedNames) | |
p <- ggplot(gotNames, aes(x=year, y=percent*100)) | |
p + geom_point() + aes(colour=factor(name)) | |
# p + geom_point() + aes(colour=factor(name)) + facet_grid(~ name) # use facet to split into multiple plots per group | |
# p + geom_point() + aes(colour=factor(name)) + facet_grid(~ sex) # use facet to split into multiple plots per group | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment