I have a column in my data frame that looks like this:
Sally
NA
NA
Bob
NA
Jill
NA
NA
Using R code, how can I get it to look like this instead:
Sally
Sally
Sally
Bob
Bob
Jill
Jill
Jill
Thanks
UPDATE: I wrote my own function "FillMe(x)" where the input is the column.
FillMe = function(x) {
empty = c()
for (i in x){
if (is.na(i) == F) {
empty = c(empty,i)
} else {
y = empty[length(empty)]
empty = c(empty,y)
}
}
return(empty)
}