[R] Legent to the Periodogram

Peter Maclean pmaclean2011 at yahoo.com
Sun Aug 28 00:39:47 CEST 2011


How Can I add a legent (showing x1, x2, x3, x4) to the last plot?
require(TSA)
require(graphics)
require(stats)
t<-1986:2011
x1<-cos(t*1990/2011)
x2<-cos(t*2000/20011)
x3<-sin(t*1990/2011)
x4<-sin(t*2000/2011)
y<-cbind(t,x1,x2, x3,x4)
y.time = ts(y.time, start=1986, frequency=1)
y.spc<-spec.pgram(y.time, spans = c(3,3), detrend=FALSE,log="no",plot = TRUE, kernel("modified.daniell", c(5,7)))
plot(y.spc, plot.type = "marginal", main="Smoothed Periodogram")


Peter Maclean
Department of Economics
UDSM



More information about the R-help mailing list