Is it possible to extend a database based on the last value?
For example:
x <- c(1, 2, 3, 4, 5)
y <- c(0.4, 0.6, 0.2, 0.2, 0.1)
df <- cbind(x, y)
I would like to be able to extend x to 10 and just use the last y value (0.1) to be populated all the way (i.e. in all the missing fields x = 6, 7, 8, 9, 10). Is it possible?