[问题] 求救QQ 时间序列分析绘图问题

楼主: kindarex (花香满庭园)   2016-08-08 16:47:43
程式咨询(我想用R 做某件事情,但是我不知道要怎么用R 写出来)
[软件熟悉度]:
新手(没写过程式,R 是我的第一次)
[问题叙述]:
各位高手大家好,谢谢上次高手说先了解时间序列分析
也开始在自学练习画图,但遇到同一个问题卡很久
我的资料是新竹2010-2014年1-12月的平均温度,
从Excel表整理好后汇入到Rstudio,开始按照youtube的影片教学
练习跟跟影片教学中https://www.youtube.com/watch?v=0gf5iLTbiQM
2小时07分开始进行练习
以下是我的资料
> d<-read.csv("C:\\Users\\1503063\\Desktop\\平均温度.csv")
> d
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2010 15.9 16.7 19 20.3 25 26.5 29.9 29.6 28.1 24.3 20.9 16.4
2011 13.3 15.2 15.5 21 24.3 28.5 28.8 29.2 27.7 24.5 22.7 16.6
2012 15.3 14.9 17.4 23.3 25.8 27.8 29.7 28.6 26.8 23.9 21 17.3
2013 5.8 17.3 19.2 20.9 26 28.9 28.9 28.9 27.7 24.2 21 16.1
2014 15.6 15.4 18 22.3 25.3 28.3 30.4 29.9 29.6 24.7 22 16
> myts <- ts(d, start=c(2010,1), end=c(2014,12), frequency=12)
> class(myts)
[1] "mts" "ts" "matrix"
> plot(myts)
出现错误是说
Error in plotts(x = x, y = y, plot.type = plot.type, xy.labels = xy.labels,
:
cannot plot more than 10 series as "multiple"
看不懂为何会出现"mts" "ts" "matrix" 而不是影片中的"ts"
然后查了资料是说class
class to be given to the result, or none if NULL or "none". The default is
"ts" for a single series, c("mts", "ts", "matrix") for multiple series.
不知道有高手知道是我哪边错误了! Q^Q 先感谢大家

Links booklink

Contact Us: admin [ a t ] ucptt.com