最近在学习用R处理时间序列,最近碰到一个问题,求大神帮忙看看。
GSPC<-as.xts(get.hist.quote('^GSPC',start='1970-01-02',end='2009-09-15',
quote=c('Open','High','Low','Close','Volume','AdjClose')))#用get.hist.quote函数在yahoo上获取标准普尔500指数,并转化为xts类
candleChart(last(GSPC,'3 months'),theme='white',TA=NULL)#用candleChart函数画个K线图
画K线图出现错误于periodicity(x) : can not calculate periodicity of 1 observation
不太明白,分明是30年左右的数据怎么会只有一个时期的数据呢?
注:需要加载的程序包
library(lattice)
library(randomForest)
library(tseries)
library(quantmod)
library(quadprog)
library(xts)
library(zoo)