我有如下所示的时间序列数据:
data
Jan Feb Mar Apr May Jun Jul Aug Sep
1960 -10.3000 -7.1000 2.9000 18.0000 18.9000 29.5000 31.4000 28.0000 20.7000
1961 -1.8000 -4.2000 4.0000 13.2000 22.0000 23.4000 24.0000 23.4000 17.3000
1962 -12.1000 -3.1000 -0.1000 9.5000 22.9000 24.4000 26.4000 30.0000 21.2000
1963 -2.9000 -5.9000 5.4000 9.3000 21.0000 25.3000 27.9000 24.6000 21.4000
1964 -2.8000 -7.4000 2.2000 9.1000 17.6000 25.3000 25.1000 25.3000 18.0000
1965 -9.5000 1.0000 6.3000 14.3000 18.3000 24.7000 28.4000 26.7000 21.9000
1966 -5.4000 -2.7000 6.6000 14.3000 17.7000 24.2000 26.2000 25.3000 20.5000
1967 -8.1000 -0.6000 3.0000 13.8000 23.2000 23.8000 27.6000 24.3000 20.4000
我想按月绘制数据,例如,我想绘制 1960-1967 年 1 月的数据。我尝试使用zoo
函数,但它不起作用。问题是即使在安装zoo
包之后,该zoo
功能似乎也无法被系统识别。错误消息如下所示:
> install.packages("zoo")
Installing package(s) into ‘C:/Users/skhanal2.RUSSELL/Documents/R/win-library/2.15’
(as ‘lib’ is unspecified)
trying URL 'http://streaming.stat.iastate.edu/CRAN/bin/windows/contrib/2.15/zoo_1.7-9.zip'
Content type 'application/zip' length 868277 bytes (847 Kb)
opened URL
downloaded 847 Kb
package ‘zoo’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘zoo’
The downloaded binary packages are in
C:\Users\skhanal2.RUSSELL\AppData\Local\Temp\RtmpCSHWVD\downloaded_packages
> test<-zoo(data,by="month")
**Error: could not find function "zoo"**
有没有人尝试按月绘制时间序列数据?如果是这样,如果有人可以帮助我找到解决方案,我将不胜感激。另外,任何人都可以提出zoo
功能问题吗?我正在使用 R 版本 2.15.2,并且在 32 位机器上使用 Windows 7。谢谢!