I have a data frame containing a variable with interspersed NAs.
I want to replace/ create a new variable replacing the NAs with the last non-NA value...I've been trying to come up with a dplyr::mutate consturction, but maybe a base R soln is better.
in any case I'm blocked up on this and would appreciate any help. see examples below: