Goal
I have a list of data frames whose dimensions are smaller than data frames in a second list. I would like to left merge them and then interpolate, to fill in the missing values. I have tried using smooth.spline() but this doesn't work with the NA's. Any suggestions?
Reprex
x <- tibble::tibble(
x = 1:9,
y = 1
)
y <- tibble::tibble(
x = c(1,3,5,6,9),
alpha = c(2,7,4,2,8)
)
z = dplyr::left_join(x = x, y = y)
z %>% dplyr::mutate(
beta = stats::smooth.spline(x = alpha, spar = 0.5)$y
)