我想在一张图上组合三个图形。来自 R 内部的数据,即“nottem”。有人可以帮助我编写代码以使用不同的颜色将季节性均值和谐波(余弦模型)及其时间序列图放在一起吗?我已经编写了模型代码,只是不知道如何将它们组合在一起进行比较。
Code :library(TSA)
nottem
month.=season(nottem)
model=lm(nottem~month.-1)
summary(nottem)
har.=harmonic(nottem,1)
model1=lm(nottem~har.)
summary(model1)
plot(nottem,type="l",ylab="Average monthly temperature at Nottingham castle")
points(y=nottem,x=time(nottem), pch=as.vector(season(nottem)))