Hi Ben, this works perfectly! thanks a lot for your help! cheers, Martin -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/summing-rasters-with-a-condition-given-by-other-rasters-tp7588222p7588242.html Sent from the R-sig-geo mailing list archive at Nabble.com.