Skip to content
Prev 205653 / 398506 Next

Question on Reduce + rollmean

Dear Gabor & Henrique,

Thanks for your suggestions on the above problem. The following is more traditional and unfanciful but it works. Suitable for a prodige like myself...

m <- matrix(1:3,3,3)
x1 <- list(m, m+1, m+2, m+3, m+4) 

out <- list()
for (i in 1:4){
t[[i]] <- Reduce("+", x1[c(i:i+1)])
}

Muhammad

Muhammad Rahiz  |  Doctoral Student in Regional Climate Modeling					
Climate Research Laboratory, School of Geography & the Environment	
Oxford University Centre for the Environment
South Parks Road, Oxford, OX1 3QY, United Kingdom 
Tel: +44 (0)1865-285194	 Mobile: +44 (0)7854-625974
Email: muhammad.rahiz at ouce.ox.ac.uk
Gabor Grothendieck wrote: