From 66fefe4cecc952f4a5c390479cfcd95af86f8b77 Mon Sep 17 00:00:00 2001 From: Vikas Rawal Date: Thu, 28 Nov 2019 17:42:34 +0530 Subject: [PATCH] Krugman edited --- acjlecturesday2.org | 9 +++++---- krugman2.png | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/acjlecturesday2.org b/acjlecturesday2.org index e89a6de..99b0fb6 100644 --- a/acjlecturesday2.org +++ b/acjlecturesday2.org @@ -28,17 +28,18 @@ Source: [[https://www.nytimes.com/2018/11/02/opinion/the-perversion-of-fiscal-po [[file:krugman2.png]] #+NAME: graph2 -#+BEGIN_SRC R :results output graphics :exports results :file krugman2.png :width 3774 :height 3774 :res 600 +#+BEGIN_SRC R :results output graphics :exports results :file krugman2.png :width 2000 :height 2000 :res 300 library(data.table) library(ggplot2) fread("~/ssercloud/acj2018/krugmandata.csv")->a - as.Date(a$date,format=c("%m/%d/%Y"))->a$date - factor(ifelse(a$date<"10-01-01","2000-2009","2010-2018"))->a$Period + as.Date(a$date,format=c("%m/%d/%y"))->a$date + factor(ifelse(a$date<"2010-01-01","2000-2009","2010-2018"))->a$Period melt(a,id=c("date","Period"),m=c("impact","unemployment"))->t levels(t$variable)<-c("Fiscal stimulus","Unemployment rate") ggplot(t,aes(x=date,y=value,group=variable,colour=Period))->p p+geom_line(size=1.2)+facet_wrap(~variable,scales="free_y",ncol=1)->p - p+scale_y_continuous("Per cent")+theme(legend.position="bottom") + p+scale_y_continuous("Per cent")+theme(legend.position="bottom")->p + p+scale_x_date("Year/Month",date_labels = "%Y") #+END_SRC diff --git a/krugman2.png b/krugman2.png index 8304b15..e1e49fa 100644 --- a/krugman2.png +++ b/krugman2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8648e53ce67b897eb0ef67622cb3ed235a479cf01aa1ade6e85246841c60b61c -size 306214 +oid sha256:84eb5a52d958f1bd608b3ec49bb4c682c4191bb6a56bde33468845faeceb21c9 +size 153638