Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ggplot2)
- library(gapminder)
- library(dplyr)
- library(tidyverse)
- setwd("/Users/Kann/Dropbox/Uni/R")
- hp<-read.csv2("huspriser.csv",sep=";",header=TRUE)
- # Filter USA to seperate dataset
- USA <- hp %>%
- filter(LOCATION == "USA")
- # Filter DK to seperate dataset
- DK <- hp %>%
- filter(LOCATION == "DNK")
- #Plotting USA and DK houseprices on top of eachother
- plot_usaDK_real <- ggplot() +
- geom_line(USA, mapping = aes(x = TIME, y=Value, color = LOCATION))+
- geom_line(DK, mapping = aes(x=TIME, y=Value, color= LOCATION))+
- labs(x = "Year", y= "REAL Houseprices",
- title = "Fig 1, Houseprices for USA and DK",
- subtitle = "index 2015 = 100",
- caption = "Source : OECD 'House Prices'")+
- theme_minimal()+
- theme(text = element_text(size = 12 ),
- axis.text.x = element_text(angle=90, vjust=0.5))+
- scale_x_continuous(breaks = 1995:2015)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement