I am using R and have a vector of dates as Day of Year (DOY) in which some days are missing. I want to find where these missing days are.
DOY <- c(1,2,5,6,7,
rDOY <- range(DOY); rnDOY <- seq(rDOY[1],rDOY[2]) rnDOY[!rnDOY %in% DOY] [1] 3 4 8 9 11 12 13 14
If instead you don't want the mssing days and do wnat the beginnings and ends of the missing items:
> DOY[ diff(DOY)!=1] [1] 2 7 10 > DOY[-1] [ diff(DOY)!=1] [1] 5 10 15