dankelley/oce — Issue #181: `decimate()` for echosounders breaks the which=2 option
Author: richardsc
Created: 2011-12-02 17:52:05+00:00
State: open

> d <- read.oce('20080701_164323.dt4')
> dd <- decimate(d, by=c(10,10))
> plot(dd, which=2)
Error in imagep(distance, -x[["depth"]], xlab = "Distance [km]", ylab = "z [m]", :
image width (339) does not match length of x (931)

Also, `decitmate()` produces a bunch of warnings about runmed which are probably easily fixed.

> dd <- decimate(d, by=c(5,10))
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In if (n < 0L) stop("wrong sign in 'by' argument") :
the condition has length > 1 and only the first element will be used
2: In if (n > .Machine$integer.max) stop("'by' argument is much too small") :
the condition has length > 1 and only the first element will be used
3: In runmed(a[r, ], byDepth) : 'k' must be odd! Changing 'k' to 11
4: In runmed(a[r, ], byDepth) : 'k' must be odd! Changing 'k' to 11
5: In runmed(a[r, ], byDepth) : 'k' must be odd! Changing 'k' to 11
6: In runmed(a[r, ], byDepth) : 'k' must be odd! Changing 'k' to 11
...