mydf <- as.data.frame(c(1,4,7,10))
mydf
# c(1, 4, 7, 10)
1 1
2 4
3 7
4 10
My function will interpolate 2 values in between each of these rows. However, as I was mentioning before the tool I'm using will not preserve the names. They are all destroyed. Therefore I know I will end up with:
1 x
2 x
3 x
4 x
5 x
6 x
7 x
8 x
9 x
10 x
How can I go back and assign the original numbers, and then the 2 new values which should the midpoints between those numbers? The correct output would be:
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10