【发布时间】:2016-09-06 00:14:20
【问题描述】:
ggplot(Price.data['2000-01/2015-12'],aes(x=Demand,y=Price))+geom_point()+geom_smooth(method=lm)
indexClass(Price.data)
[1] "Date"
如何仅绘制 2010-2014 年的 3 月、4 月和 6 月数据?
head(Price.data)
Dry_Gas_Y Power_Gas_Y Price_Gas_Y
1990-01-01 52.16720 5.469179 2.39
1990-02-01 51.45287 5.470755 1.90
1990-03-01 49.29829 6.908609 1.55
1990-04-01 48.29243 7.721371 1.49
1990-05-01 47.25959 9.154057 1.47
1990-06-01 47.48744 11.525595 1.47
【问题讨论】:
-
你能提供一个可重现的例子吗?还是您的数据集样本?特别是,我们需要您的
date列的格式
标签: r ggplot2 time-series subset xts