## create character vectors
dts <- c("1989-09-28", "2001-01-15", "2004-08-30", "1990-02-09")
tms <- c( "23:12:55", "10:34:02", "08:30:00", "11:18:23")
## timeDate
GMT <- timeDate(dts, zone = "GMT", FinCenter = "GMT") + 24*3600
GMT
## suitably lagged and iterated differences
diff(GMT)
diff(GMT, lag = 2)
diff(GMT, lag = 1, diff = 2)
Run the code above in your browser using DataLab