Skip to content

Instantly share code, notes, and snippets.

@cdesante
Created November 11, 2012 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdesante/4056721 to your computer and use it in GitHub Desktop.
Save cdesante/4056721 to your computer and use it in GitHub Desktop.
legends1
toInstall <- c("ggplot2", "reshape")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
library(ggplot2)
library(reshape)
ANES <- read.csv("http://www.oberlin.edu/faculty/cdesante/assets/downloads/ANES.csv")
party.and.region <- ANES[,c(1, 12, 16)]
party.and.region.year <- melt(party.and.region, id=c("year", "south"), na.rm=TRUE)
party.region.time <- (cast(party.and.region.year, year+south~variable, mean, na.rm=T) )
P0 <- ggplot(data = party.region.time
) + geom_point(aes(x = year,
y = pid7,
size=(1),
colour=as.factor(south),
shape=factor(south))) +theme_bw()
P0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment