dankelley/oce — Issue #183: bug in time for decimate echosounder
Author: richardsc
Created: 2011-12-03 12:45:46+00:00
State: open

Can be fixed with the following diff:

|3td|paddle:R[develop]$ git diff misc.R
diff --git a/R/misc.R b/R/misc.R
index a876019..ecfde08 100644
--- a/R/misc.R
+++ b/R/misc.R
@@ -1080,7 +1080,7 @@ decimate <- function(x, by=10, to, filter, debug=getOption("oceDebug"))
ncol <- ncol(a)
nrow <- nrow(a)
jj <- 1:nrow
- time2 <- binAverage(jj, as.numeric(x[["latitude"]]), 1, nrow, byPing)$y + as.POSIXct("197
+ time2 <- binAverage(jj, as.numeric(x[["time"]]), 1, nrow, byPing)$y + as.POSIXct("1970-01
a2 <- matrix(nrow=length(time2), ncol=ncol(a))
for (c in 1:ncol)
a2[,c] <- binAverage(jj, runmed(a[,c], kPing), 1, nrow, byPing)$y