
x <- c(0,0,1,2,3,0,0,4,5,6)

 

How to identify the regions of non-zeros and average c(1,2,3) and c(4,5,6) to get 2 and 5. 

 

Thanks

 
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.

	[[alternative HTML version deleted]]

