I have a data with one time column and 2 variables.(example below)
df <- structure(list(time = c(15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26), var1 = c(20.4, 31.5, NA, 53.7, 64.8, NA, NA, NA, NA,
120.3, NA, 142.5), var2 = c(30.6, 47.25, 63.9, 80.55, 97.2, 113.85,
130.5, 147.15, 163.8, 180.45, 197.1, 213.75)), .Names = c("time",
"var1", "var2"), row.names = c(NA, -12L), class = c("tbl_df",
"tbl", "data.frame"))
The var1 has few NA and I want to fill the NA with linear regression between remaining values in var1 and var2.
Please Help!! And let me know if you need more information