THIS ENTRY IS SUPERCEDED BY THIS PAGE.
THIS ENTRY SUPERCEDE THIS
1.
# download
# use file name "CLI3.csv".
# this file contains multiple regions data.
# extract USA only entries
# execute commands below at "~/Download".
#
sed -n '/USA/p' CLI3.csv |awk -F, '{print $6"-01,"$7}' |sed 's/\"//g' |awk 'BEGIN{print "DATE,DATA"}{print $0}' > usa.csv
# extract OECD entries and exclude OECDE
sed -n '/OECD[^E]/p' CLI3.csv |awk -F, '{print $6"-01,"$7}' |sed 's/\"//g' |awk 'BEGIN{print "DATE,DATA"}{print
2.drawing graph
#
#
c
sv")
))
#
# set start date and end date
#
s
end_
#
#
cli
period_base <- paste(start_date,end_date,sep="::")
diff_mon <- 6
period_compare <- paste(as.Date(as.yearmon(mondate(as.Date(start_date))-diff_mon )),as.Date(as.yearmon(mondate(as.Date(end_date))-diff_m
plot.default((cli_xts$oecd[peri
plot.default((cli_xts$oecd[period_base] / as.vector(cli_xts$oecd[period_compare])-1)*100,cli_xts$oecd[period_base] ,xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tm
#
# code for CY2019 and after.
#
#
# add line to data beyond "20
plot.default((cli_xts$oecd[paste("2019-01",end_date,sep="::")] / as.vector(cli_xts$oecd[paste("2018-07",as.Date(as.yearmon(mondate(as.Date(end_date))-diff_mon )),sep="::")])-1)*100,cli_xts$oecd[paste("2019-01",end_date,sep="::")] ,xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4])
plot.default((cli_xts$oecd["2018-01::2018-12"] / as.vector(cli_xts$oecd["2017-07::2018-06"])-1)*100,cli_xts$oecd["2018-01::2018-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], t
}
plot.default((cli_xts$oecd[paste("2018-01",end_date,sep="::")] / as.vector(cli_xts$oecd[paste("2017-07",as.Date(as.yearmon(mondate(as.Date(end_date))-diff_mon )),sep="::")])-1)*100,cli_xts$oecd[paste("2018-01",end_date,sep="::")] ,xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3], tmp[4])
}
plot.default((cli_xts$oecd["2017-01::2017-12"] / as.vector(cli_xts$oecd["2016-07::2017-06"])-1)*100,cli_xts$oecd["2017-01::2017-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3],
plot.default((cli_xts$oecd["2016-01::2016-12"] / as.vector(cli_xts$oecd["2015-07::2016-06"])-1)*100,cli_xts$oecd["2016-01::2016-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3],
plot.default((cli_xts$oecd["2015-01::2015-12"] / as.vector(cli_xts$oecd["2014-07::2015-06"])-1)*100,cli_xts$oecd["2015-01::2015-12"], xlim=c( tmp[1],tmp[2]), ylim=c(tmp[3],
legend("topleft", legend = "Light Blue: 2015\nBlue: 2016\nLime: 2017\nRed: 2018",bty='n')