library(gdata) library(xts) library(quantmod) topix2015 <- read.csv("/home/user/R/work/I102_2015.csv", header=F,skip=2) names(topix2015)<-c("Date","Open","High","Low","Close") load("topix1991_2014.dat") topix<-rbind(topix2015,topix1991_2014) topix.xts <- as.xts(zoo(topix[,-1]), as.POSIXct(topix[,1])) d2014<-read.xls("2014.xls",sheet=1,header=F,skip=8) d2014<-d2014[,2:4] names(d2014)<-c("date","ETF","REIT") load("d2010_201403.dat") d<-rbind(d2010_201403,d2014) d.xts <- as.xts(zoo(d[,-1]),as.POSIXct(d[,1])) start<-"2010-10-15" ; end<-"2015-01-09" r<-as.POSIXct(c(start,end)) t<-paste(start,"::",end,sep="") par(oma = c(0,3, 0, 3)) plot(topix.xts$Close[t],main=paste("TOPIX & 日本銀行 ETF 買入額(",start,"~",end,")"),xlim=c(r[1],r[2]),ylim=c(500,1500),las=1) mtext("TOPIX",side = 2, line = 4) par(new=T) plot(d.xts[t,1],type="h",xlim=c(r[1],r[2]),ylim=c(0,1000),xaxt="n",xlab="",yaxt="n",ylab="",main="",col="red") axis(4,las=1) mtext("ETF 買入額(億円)",side = 4, line = 3)
|