2014年におけるゴールド、原油、10年物米国財務省証券金利、SP500、日経平均株価、FTSEその他株式等のヒートマップ

heatmap_FTSE.Close_2014-09-15 heatmap_GSPC.Close_2014-09-15

heatmap_DGS10_2014-09-15 heatmap_DCOILWTICO_2014-09-15

heatmap_GOLDAMGBD228NLBM_2014-09-15 heatmap_MCD.Close_2014-09-15

heatmap_TWTR.Close_2014-09-15 heatmap_FB.Close_2014-09-15 heatmap_N225.Close_2014-09-15

#conditions
FirstDate<-as.Date("2000/1/11")
LastDate<-as.Date("2014/12/31")
#package
library(quantmod) # http://cran.r-project.org/web/packages/quantmod/quantmod.pdf
library(openair)# http://cran.r-project.org/web/packages/openair/openair.pdf
#path
username<-Sys.info()['user']
path01<-paste("C:/Users/",username,"/Desktop/R_Data_Read/",sep="")
path02<-paste("C:/Users/",username,"/Desktop/R_Graph/",sep="")
path03<-paste("C:/Users/",username,"/Desktop/R_Data_Write/",sep="")
#symbols
symbol<-c("GOLDAMGBD228NLBM","DCOILWTICO","DGS10","^GSPC","^FTSE","^N225","FB","TWTR","MCD")
#graph
setwd(path02)
for(iii in 1:length(symbol)){
if(iii<=3){
location<-"FRED"
title<-symbol[iii]
}else{
location<-"yahoo"
title<-gsub("\\^","",paste(symbol[iii],".Close",sep=""))
} 
png(file=paste("heatmap_",title,"_",Sys.Date(),".png",sep=""),width=800,height=800)
par(mar=c(5,5,5,5),ps=22,cex.axis=1,cex.lab=1,cex.main=1,cex.sub=1)
tmp<-getSymbols(symbol[iii],src=location,auto.assign=FALSE) #,from=FirstDate,to=LastDate,
tmp<-data.frame(date = index(tmp), tmp, row.names=NULL)
calendarPlot(tmp, pollutant = title, year = "2014", cols="jet")
dev.off()
}