Re: [R] Extracting windows from time series

2016-04-06 Thread Jim Lemon
Hi Matthias, It looks to me as though you could do this with a couple of loops: temps<-rnorm(400,14,0.05) ttind<-NULL for(ti in 1:(length(temps)-9)) { if(temps[ti]-temps[ti+9] >= 0.1 && max(temps[ti]-temps[ti+1:9]) > -0.05) ttind<-c(ttind,ti) } cat("\t\t",paste("Year",1:10,sep=""),"\n") for(ti

[R] Extracting windows from time series

2016-04-06 Thread maettuw
Dear R Users Thanks for the help in advance and lets get straight to the problem: I have a 400 year long temperature time series and I am looking for decades that show a linear trend decrease of approximately -0.1 Kelvin or degrees. --> What I would like to program: A loop/function / command lin