I\'ve got a samples
data frame which contains some readings at regularily-spaced timestamps (1 sec. interval).
TS Pr
samples$eventID <- cumsum(c(TRUE,diff(as.POSIXct(samples$TS))>1))
samples
# TS Pressure Temperature eventID
#8 2014-08-26 00:18:26.8 105.0 30 1
#9 2014-08-26 00:18:27.8 108.0 32 1
#10 2014-08-26 00:18:28.8 109.9 31 1
#11 2014-08-26 00:34:20.8 109.0 20 2
#12 2014-08-26 00:34:21.8 100.0 24 2
#13 2014-08-26 00:34:22.8 95.0 22 2