我是ggplot的新手,虽然这看起来像一个简单的问题,但我很困惑 . 我收到错误消息
不知道如何自动选择xts / zoo类型的对象的比例 . 违约持续 .
我输出了't see a line on my graph. Here':
这是我的代码:
> library(quantmod)
> library(TTR)
> library(ggplot2)
> getSymbols("SPY")
[1] "SPY"
> price<-SPY[,1]
> ggplot(price,aes(x=time(price),y=price),geom_line(color="blue"))
1 回答
zoo提供
autoplot.zoo
用ggplot2绘制xts / zoo对象:另请查看使用经典图形的
chart_Series
(来自quantmod):