Complete a column using the last complete value and values from another column

Hi, and welcome!

Thanks for the reproducible example, called a reprex. These make things so much more efficient for everyone.

Help me clarify my understanding. Taking the first few rows

> df
# A tibble: 19 x 4
   date       f                 var indice
   <date>     <chr>           <dbl>  <dbl>
 1 2019-08-01 observado   0.00164     119.
 2 2019-09-01 auto.arima  0.000789     NA 
 3 2019-10-01 auto.arima  0.000379     NA 

Should row 2 be

2 2019-09-01 auto.arima  0.000789     0.09389 

and row 3

 3 2019-10-01 auto.arima  0.000379     3.558e-05 

That is indice at t_i should equal indice at t_{i -1} * var at t_i?

1 Like