fillGap {oce} | R Documentation |
Fill a gap in an oce object
fillGap(x, method=c("linear"), rule=1)
x |
an |
method |
to use; see “Details”. |
rule |
integer controlling behaviour at start and end of |
Sequences of NA
values, are filled by linear
interpolation between the non-NA
values that bound the gap.
A new oc
object, with gaps removed.
Eventually, this will be expanded to work with any
oce
object. But, for now, it only works for vectors that can
be coerced to numeric.
If the first or last point is NA
, then x
is returned unaltered.
Only method linear
works now, and that argument is
ignored at present.
Dan Kelley
library(oce) # Integers x <- c(1:2, NA, NA, 5:6) y <- fillGap(x) print(data.frame(x,y)) # Floats x <- x + 0.1 y <- fillGap(x) print(data.frame(x,y))