I have a data frame like this:
var1   var2
a      1
b      NA
c      NA
d      2
e      NA
f      3
g      3
I need the following data frame
var1   var2
a      1
b      1
c      1
d      2
e      2
f      3
g      3
I need the way of replacing NA value with last no-NA value of the column var2.
Thank you for your help.
 
    