Hi All, I have a time series called 'upwelling', like this:>upwellJan Feb Mar Apr May Jun Jul Aug Sep Oct Nov 1984 494.7 303.7 220.8 288.4 188.1 125.5 215.7 1985 56.0 127.4 165.8 189.4 261.6 223.7 186.3 150.2 107.8 120.3 91.1 from 1984 until 2000. How do I could extract, i.e, Jan or Dec columns from the data? Or how do I could calculate, say, winter upwelling: Dec+Jan+Feb+Mar? Thanks, Antonio PD: Does anybody knows if the EM algorithm (Shumway and Stoffer) for missing data, has been developped within R? Antonio Rodr?guez Verdugo C.I.C.E.M. "Agua del Pino" Delegacion Provincial de Agricultura y Pesca P.O. Box 104 21071 HUELVA (Spain) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Antonio wrote:> > Hi All, > > I have a time series called 'upwelling', like this: > > >upwell > > Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov > 1984 494.7 303.7 220.8 288.4 188.1 125.5 215.7 > 1985 56.0 127.4 165.8 189.4 261.6 223.7 186.3 150.2 107.8 120.3 91.1 > > from 1984 until 2000. How do I could extract, i.e, Jan or Dec columns from > the data? Or how do I could calculate, say, winter upwelling: Dec+Jan+Feb+Mar?See ?window For Dec columns use window(upwell, start=c(1984, 12), frequency=1) Don't know an exact translation for "upwelling" in german, but to sum over the specified 4 months, you can use: sum(window(upwell, start=c(1984, 12), end=c(1985,3))) Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi Uwe>For Dec columns use > window(upwell, start=c(1984, 12), frequency=1)This works OK But the other formula not. Maybe is my fault, I was not clear. What I need is: (Dec(t-1)+Jan(t)+Feb(t)+March(t))/4 With your help I did the following: - I extracted each series as you mentioned above, then I convert them this way: dec<- window(upwell, start=c(1984, 12), frequency=1) d<-dec[c(1:16)] and so on with Jan, Feb, March Then: wintermean<-(d+j+f+m)/4 And.. Goal! Maybe is long, long walk, but it works Cheers, Antonio Antonio Rodr?guez Verdugo C.I.C.E.M. "Agua del Pino" Delegacion Provincial de Agricultura y Pesca P.O. Box 104 21071 HUELVA (Spain) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._