have you tried na.locf(d)?
May 31, 2012, 9:17:44 PM
Posted to Replacing 0 with NA - an evergreen from the list