[R] replacing zeros with above/below numbers ?

ce zadig_1 at excite.com
Thu Feb 6 04:05:46 CET 2014


Dear all,

 My data is :

a <- c(0.9721,0.9722,0.9730,0.9723,0.0,0.0,0.0,0.9706,0.9698,0.0,0.9710,0.9699)

I want to replace zeros with  average of before and after values of them.  But sometimes there is one zero sometimes more than one. What is the most elegant way to do this ?
Thanks a lot



More information about the R-help mailing list