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]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.