I have an irregular time series contained in xts and separate time index vector (endpoints). I want to calculate statistics for every index point based on preceding 5 seconds for every endpoint. So, starting point should be 5 seconds before every endpoint. These periods may overlap.I have an irregular time series contained in xt