Re: [R] Trimming time series to only include complete years

2016-06-01 Thread Morway, Eric
Hello Jeff, thank you very much for following up with me on this. It definitely helped me get on my way with my analysis. It figures your from UC Davis (I'm guessing from your email address), I've been helped out by them often! -Eric Eric Morway Hydrologist 2730 N. Deer Run Rd. Carson City, N

Re: [R] Trimming time series to only include complete years

2016-05-30 Thread Jeff Newmiller
Sorry, I put too many bugs (opportunities for excellence!) in this on my first pass on this to leave it alone :-( isPartialWaterYear2 <- function( d ) { dtl <- as.POSIXlt( d ) wy1 <- cumsum( ( 9 == dtl$mon ) & ( 1 == dtl$mday ) ) # any 0 in wy1 corresponds to first partial water year res

Re: [R] Trimming time series to only include complete years

2016-05-28 Thread Jeff Newmiller
# read about POSIXlt at ?DateTimeClasses # note that the "mon" element is 0-11 isPartialWaterYear <- function( d ) { dtl <- as.POSIXlt( dat$Date ) wy1 <- cumsum( ( 9 == dtl$mon ) & ( 1 == dtl$mday ) ) ( 0 == wy1 # first partial year | ( 8 != dtl$mon[ nrow( dat ) ] # end partial year