library(dplyr)
library(zoo)
df <- df %>%
mutate(column_name = na.approx(column_name))
library(dplyr)
library(zoo)
#interpolate missing values in 'sales' column
df <- df %>%
mutate(sales = na.approx(sales))
#view updated data frame
df
day sales
1 1 3
2 2 6
3 3 8
4 4 10
5 5 14
6 6 17
7 7 20
8 8 23
9 9 26
10 10 29
11 11 32
12 12 35
13 13 39
14 14 44
15 15 49