In Excel, enter the following to the leftest-top:
[The "difference" (in seconds between (ordered) datetimes and the base 24.01.2016 03:20:00 whose value is assigned to 0) column was obtained via the formula "=(B3-$B$2)*86400"]
name datetime difference old new
1051 24.01.2016 03:20:00 0 NA NA
1051 24.01.2016 03:22:37 157 38656 38400
1051 24.01.2016 03:30:00 600 NA NA
1051 24.01.2016 03:40:00 1200 NA NA
1051 24.01.2016 03:50:00 1800 NA NA
1051 24.01.2016 03:56:33 2193 5120 4864
1051 24.01.2016 04:00:00 2400 NA NA
1051 24.01.2016 04:03:28 2608 5888 5632
1051 24.01.2016 04:34:22 4462 5632 38144
1051 25.01.2016 04:10:00 89400 NA NA
1051 25.01.2016 08:08:16 103696 37376 37632
Then, File - Save as - [FileName:seymaalaca.csv; Type: "CSV (comma separated) (*.csv)"]
mydataframe <- read.csv("C:/Users/User/Documents/Revolution/seymaalaca.csv", header=TRUE, sep=",", stringsAsFactors = FALSE)
mydataframe # results in:
name datetime difference old new
1 1051 24.01.2016 03:20:00 0 NA NA
2 1051 24.01.2016 03:22:37 157 38656 38400
3 1051 24.01.2016 03:30:00 600 NA NA
4 1051 24.01.2016 03:40:00 1200 NA NA
5 1051 24.01.2016 03:50:00 1800 NA NA
6 1051 24.01.2016 03:56:33 2193 5120 4864
7 1051 24.01.2016 04:00:00 2400 NA NA
8 1051 24.01.2016 04:03:28 2608 5888 5632
9 1051 24.01.2016 04:34:22 4462 5632 38144
10 1051 25.01.2016 04:10:00 89400 NA NA
11 1051 25.01.2016 08:08:16 103696 37376 37632
oldcolumn <- lm(mydataframe$old ~ mydataframe$difference)
oldcolumn # old = 1.348e+04 + 2.233e-01*difference
oldfunction <- function (difference) {1.348e+04 + 2.233e-01*difference} # produces the row values for the "old" column
newcolumn <- lm(mydataframe$new ~ mydataframe$difference)
newcolumn # new = 2.14e+04 + 1.56e-01*difference
newfunction <- function (difference) {2.14e+04 + 1.56e-01*difference} # produces the row values for the "new" column
myinterpolizer <- function (difference) {c(oldfunction(difference),newfunction(difference))} # produces the row values for the "old&new" column
myinterpolizer(0) # 13480 21400
myinterpolizer(600) # 13613.98 21493.60
myinterpolizer(1200) # 13747.96 21587.20
myinterpolizer(1800) # 13881.94 21680.80
myinterpolizer(2400) # 14015.92 21774.40
myinterpolizer(89400) # 33443.02 35346.40
A little simpler one-liner that produces the above 12 numbers:
# mydataframe[is.na(mydataframe$old),] # filters the rows where old=NA
# mydataframe[is.na(mydataframe$old),3] # After (filtering the rows where old=NA) select (the "difference" column)
lapply(mydataframe[is.na(mydataframe$old),3], myinterpolizer)