Skip to content

Instantly share code, notes, and snippets.

@thomasjensen
Created February 8, 2012 22:14
Show Gist options
  • Save thomasjensen/1774468 to your computer and use it in GitHub Desktop.
Save thomasjensen/1774468 to your computer and use it in GitHub Desktop.
eurobarometer survey
library(ggplot2)
setwd("/path/to/file/")
data <- read.csv("ebAll.csv")
data$date <- as.Date(data$date, format = "%y/%m/%d")
data$Tend.to.trust <- as.numeric(gsub("%","",data$Tend.to.trust))
data$Tend.not.to.trust <- as.numeric(gsub("%","",data$Tend.not.to.trust))
data$DK...Don.t.know <- as.numeric(gsub("%","",data$DK...Don.t.know))
ggplot(data[data$MS == "EU",], aes(x = date, y = Tend.to.trust, group = Question, linetype = Question)) +
geom_line() +
theme_bw() +
facet_grid(.~MS) +
xlab("") +
ylab("Trust in Percent") +
opts(axis.text.x = theme_text(angle=90, hjust=0, size=10))
ggplot(data[data$MS %in% c("Greece","Ireland","Portugal"),], aes(x = date, y = Tend.to.trust, group = Question, linetype = Question)) +
geom_line() +
theme_bw() +
facet_grid(.~MS) +
xlab("") +
ylab("Trust in Percent") +
opts(axis.text.x = theme_text(angle=90, hjust=0, size=10))
ggplot(data[data$MS == "Denmark",], aes(x = date, y = Tend.to.trust, group = Question, linetype = Question)) +
geom_line() +
theme_bw() +
facet_grid(.~MS) +
xlab("") +
ylab("Trust in Percent") +
opts(axis.text.x = theme_text(angle=90, hjust=0, size=10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment