I have the following data frame in R:
Date Accumulated
1 2016-10-01 6902000
2 2016-11-01 9033000
3 2017-06-01 15033000
4 2017-11-01 24033000
5 2019-05-01 24533000
6 2019-08-01 25033000
7 2019-11-01 27533000
8 2020-06-01 29033000
I'm interested in completing with rows for the missing months in the "Data" column while applying a linear or spline interpolation (preferably a spline interpolation) in the "Accumulated" column (i.e., I need rows for 2016-12-01, 2017-01-01, 2017-02-01, 2017-03-01, and so on).
I have seen another questions where people recommend using the "zoo" and "data.table" packages where they first create the rows with "NA" and then apply the interpolation... But I'm not sure how to do this because my data is organized differently (all of my Date data is in one column, in contrast to this case for example: r - insert row for missing monthly data and interpolate). However I'm still relatively new to R and managing different types and classes of data is very difficult for me. I'm sure there's an easy way to do this.
Thank you very much.