I have two sets of (sorted) POSIXct time series like this:
set.seed(123) ll = sort(strptime(\"16/07/2015\", format=\"%d/%m/%Y\") + 10*3600 + 1:3600 + round(rnorm
Just use findInterval:
findInterval
array(findInterval(tt1,ll),dim(tt1)) #head(array(findInterval(tt1,ll),dim(tt1))[,1:4]) # [,1] [,2] [,3] [,4] #[1,] 729 729 731 732 #[2,] 740 741 742 743 #[3,] 748 749 751 752 #[4,] 759 760 760 762 #[5,] 770 772 773 774 #[6,] 780 781 783 785