[R] how to manupute data frame with conditions fill cell with previous value if next cell is zero

Gabor Grothendieck ggrothendieck at gmail.com
Sun Apr 6 18:08:00 CEST 2008


On Sun, Apr 6, 2008 at 9:04 AM, saikat sarkar <dipa_sanyal at yahoo.com> wrote:

> This is the 2nd time in the chat room. Its a great place to get help from R
> experts.

I assume you are referring to this email list.  I am not aware of
a chat room but if it exists that is something different from this
list.

> I have a data frame problem, it contains thousands of data.

Actually you don't have a data frame problem.  You have a time
series problem and by representing it as a data frame instead of
a time series you are running into one problem after another that
would be trivially addressed with the correct representation.

See ?na.locf in the zoo package.



More information about the R-help mailing list