I have a data frame with missing values:
X Y Z
54 57 57
100 58 58
NA NA NA
NA NA NA
NA NA NA
60 62 56
NA NA NA
NA NA NA
69 62 62
I can recommend the imputeTS package, which I am maintaining (even if it's for time series imputation)
For this case it would work like this:
library(imputeTS)
df$X <- na.interpolation(df$X, option ="linear")
df$Y <- na.interpolation(df$Y, option ="linear")
df$Z <- na.interpolation(df$Z, option ="linear")
As mentioned the package requires time series / vector input. (that's why each column has to be called seperatly)
The package offers also a lot of other imputation functions like e.g. spline interpolation.