I have a data.frame x with date and Value
x
date
Value
x = structure(list(date = structure(c(1376534700, 1411930800, 1461707400, 1
sapply(y, function(z) x$Value[which.min(abs(x$date - z))]) # [1] 40 65 44 67 44