Skip to content
Prev 370045 / 398503 Next

Fill in empty cell in data.frame from previous value

Run it through a loop. I assume the cell contents is NA (Not Available). Test for it with is.na(). Whenever that returns TRUE, replace the NA value with the value from the previous row.

Cheers,
B.