what i have:
colA colB colC
pen 2 1
NA yes no
NA yes NA
pencil 1 2
NA yes no
NA no NA
what i want is all the NA in colA to be replaced with the preceding value.
colA colB colC
pen 2 1
pen yes no
pen yes NA
pencil 1 2
pencil yes no
pencil no NA
How can i get this in R.? Thank you for your help.