使用下面的代码我制作了一个情节1,但它没有显示年份。我在走错了。数据是5分钟的日内数据。
#load data
aapl<-read.table("AAPL_trades.txt",header=T)
dim(aapl)
head(aapl)
#make xts object
date<-aapl$Date.Time
date<-as.Date(date)
date<-as.Date(date,"%Y-%m-%d")
AAPL.O<-aapl$AAPL
price<-xts(AAPL.O,date)
head(price)
plot(price,type="l",main="APPLE 5-min intraday price",xlab="Date.Time",ylab="5min price")
5-min intraday plot of AAPL price
dput(price)
....... ...... ...... 1106006400,1106006400,1106006400,1106006400,1106006400,1106006400, 1106006400,1106006400,1106006400,1106006400,1106006400,1106006400, 1106006400,1106006400,1106006400,1106006400,1106006400,1106006400, ...... ..... ..... 1137628800,1137628800,1137628800,1137628800,1137628800,1136628800, 1137628800,1137628800,1137628800,1137628800),tzone =&#34; UTC&#34;,tclass =&#34;日期&#34;),类= c(&#34; xts&#34;, &#34; zoo&#34;),. indexStASS =&#34; Date&#34;,tclass =&#34; Date&#34;,。indexTZ =&#34; UTC&#34;,tzone =&#34 ; UTC&#34)