Skip to content

Instantly share code, notes, and snippets.

@cdesante
Created October 23, 2012 17:35
Show Gist options
  • Save cdesante/3940250 to your computer and use it in GitHub Desktop.
Save cdesante/3940250 to your computer and use it in GitHub Desktop.
cast7
head(ANES)
party.gender.region <- ANES[,c(1, 4, 12, 16)]
head(party.gender.region)
#Note the additional changes to our id=():
party.gender.region.year <- melt(party.gender.region,
id=c("year", "female", "south"), na.rm=TRUE)
head(party.gender.region.year)
#Note the additional changes to our formula (below):
party.gender.region.time <- (cast(party.gender.region.year,
year+female+south~variable, mean, na.rm=T) )
party.gender.region.time
party.gender.region.time <- party.gender.region.time[complete.cases(party.gender.region.time),]
dim(party.gender.region.time)
P3 <- ggplot(data = party.gender.region.time) + geom_point(aes(x = year,
y = pid7, colour=factor(south) )) + facet_grid(~female)
P3 <- P3 + ylim(0,6) + labs(title="geom_point, P3")
P3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment