Created
September 17, 2013 04:35
-
-
Save rpietro/6590113 to your computer and use it in GitHub Desktop.
education vs employment for OECD data
This file contains hidden or 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
# setting working directory | |
setwd("~/Desktop") | |
# calling packages, need to install packages with install.packages if you haven't installed them before | |
library(ggplot2) | |
library(lubridate) | |
#------------------------------------------------------------------------------ | |
# importing data | |
edobs <- read.csv("ed_obs.csv", stringsAsFactors=FALSE, header = TRUE) | |
str(edobs) | |
names(edobs) | |
# > names(edobs) | |
# [1] "json" "country" "year" "empl" "ed" | |
table(edobs$country) | |
#emerging markets according with any of the classifications under http://goo.gl/mY1B30 : | |
# Czech Republic, Greece, Hungary, Mexico, Poland, Slovak Republic, Turkey | |
#------------------------------------------------------------------------------ | |
qplot(empl, ed, data = edobs) | |
qplot(empl, ed, data = edobs, color = country) #doesn't work well since there are so many countries, need to create variable for emerging countries (yes/no) according to IMF and then use it as facet | |
qplot(empl, ed, data = edobs, geom = c("point", "smooth")) # mixes both years, not good | |
qplot(empl, ed, data = edobs, geom = c("point", "smooth"), facets = . ~ year) # better but need to combine into a single plot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment