a) movingtotal(a, -2, 0, 1, time status) gave the following resultsDAY_02-JAN-11 NA NA
b) movingtotal(a, -2, 0, 1, time a ne na) should give you what you need.DAY_02-JAN-11 NA NA
c) However the 3 part soln listed out earlier (rather painfully, i admit :-) ) will densify the data along dates resulting in the last non nul value being used for days w/o data or with na data.DAY_02-JAN-11 NA NA
i.e. End result of step1/2/3 in soln will give last non null value for days like 07-Jan, 08-Jan and 09-Jan for which the base measure is na.