Also could be:
fillInTheBlanks <- function(x) { for (i in 1:(length(x)-1)) { if(is.na(x[i+1]) == T) { x[i+1] <- x[i] } } return(x) }