# TODO: Add comment # # Author: Gene ############################################################################### FixDaylightSavings = function(dat){ #browser() timeshiftBeg = which(diff(dat) > +.04) timeshiftEnd = which(diff(dat) < -.04) ## Make a copy of the data, and adjust the copy datAdj = dat ## Apply the adjustments to the start and end time of the time change datAdj[(timeshiftBeg+1):(timeshiftEnd)] = datAdj[(timeshiftBeg+1):(timeshiftEnd)] - 1/24 ## I realized later that I would rather have the middle part (summer) ## stay the same, and the first and end parts (winter) modified. ## Rather than rewrite the above code, I'm just shifting the whole thing. datAdj = datAdj + 1/24 return(datAdj) }