I'm working with a data set that has a date column in which the date is only recorded when it changes, meaning that any NAs are assumed to be equal to the most recently recorded date. I want to fill in missing dates based on that logic. Here's an example of what the data might look like:
Date | Value |
---|---|
10/2/2015 | A1 |
NA | A2 |
NA | A3 |
NA | A4 |
10/3/2015 | B1 |
NA | B2 |
NA | B3 |
And here's the desired result:
Date | Value |
---|---|
10/2/2015 | A1 |
10/2/2015 | A2 |
10/2/2015 | A3 |
10/2/2015 | A4 |
10/3/2015 | B1 |
10/3/2015 | B2 |
10/3/2015 | B3 |
Thanks!