Displaying 2 results from an estimated 2 matches for "ttind".
2016 Apr 07
2
Storing output of loop into list()
Hello. I am trying to store the output from a loop into a matrix. Failed so far, thanks for the help.
What I want to store into a new matrix: (just run the code once):
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)
}
for(ti in 1:length(ttind)) {
print(round(temps[ttind[ti]:(ttind[ti]+9)],3))
}
My (failed) soultion attempt:
temps<-rnorm(400...
2016 Apr 06
1
Extracting windows from time series
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 line that prints the values of all the trends (can also be overlapping) into a matrix that could have